Skip to content

Commit 7613342

Browse files
committed
[error] adding exceptions for blocking user actions
1 parent af09c99 commit 7613342

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

pywa/errors.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class FlowError(WhatsAppError):
394394
"""
395395
Base exception for all flow errors.
396396
397-
Read more at `developers.facebook.com <https://developers.facebook.com/docs/whatsapp/flows/reference/error-codes>`_.
397+
- Read more at `developers.facebook.com <https://developers.facebook.com/docs/whatsapp/flows/reference/error-codes>`_.
398398
"""
399399

400400
__error_codes__ = None
@@ -458,3 +458,34 @@ class FlowDeletingError(FlowError):
458458
"""
459459

460460
__error_codes__ = (139004,)
461+
462+
463+
# ====================================================================================================
464+
465+
466+
class BlockUserError(WhatsAppError):
467+
"""
468+
Base exception for all block user errors.
469+
470+
- Read more at `developers.facebook.com <https://developers.facebook.com/docs/whatsapp/cloud-api/block-users#error-codes>`_.
471+
"""
472+
473+
__error_codes__ = None
474+
475+
476+
class BulkBlockingFailed(BlockUserError):
477+
"""Bulk blocking failed to block some or all of the users."""
478+
479+
__error_codes__ = (139100,)
480+
481+
482+
class BlockListLimitReached(BlockUserError):
483+
"""The blocklist limit is reached when the 64k limit is met."""
484+
485+
__error_codes__ = (139101,)
486+
487+
488+
class BlockListConcurrentUpdate(BlockUserError):
489+
"""Occurs when the block list is updated while performing a pagination request and version_id does not match."""
490+
491+
__error_codes__ = (139102,)

0 commit comments

Comments
 (0)