Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/aleph/chains/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from aleph.exceptions import (
AlephStorageException,
InvalidContent,
ContentCurrentlyUnavailable, UnknownHashError,
ContentCurrentlyUnavailable,
UnknownHashError,
InvalidMessageError,
)
from aleph.handlers.forget import handle_forget_message
from aleph.handlers.storage import handle_new_storage
Expand Down Expand Up @@ -136,9 +138,12 @@ async def incoming(
if check_message:
if existing is None or (existing["signature"] != message["signature"]):
# check/sanitize the message if needed
message = await check_message_fn(
message, from_chain=(chain_name is not None)
)
try:
message = await check_message_fn(
message, from_chain=(chain_name is not None)
)
except InvalidMessageError:
return IncomingStatus.FAILED_PERMANENTLY, []

if message is None:
return IncomingStatus.MESSAGE_HANDLED, []
Expand Down