Skip to content

Commit

Permalink
art: Log warning for bad credential format, instead of always excepti…
Browse files Browse the repository at this point in the history
…on stacktrace

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Jan 29, 2025
1 parent ac0cbbf commit 00453f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion acapy_agent/protocols/issue_credential/v2_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,12 @@ async def credential_exchange_send(request: web.BaseRequest):
V20CredManagerError,
V20CredFormatError,
) as err:
LOGGER.exception("Error preparing credential offer")
# Only log full exception for unexpected errors
if isinstance(err, (V20CredFormatError, V20CredManagerError)):
LOGGER.warning(f"Error preparing credential offer: {err.roll_up}")
else:
LOGGER.exception("Error preparing credential offer")

if cred_ex_record:
async with profile.session() as session:
await cred_ex_record.save_error_state(session, reason=err.roll_up)
Expand Down

0 comments on commit 00453f8

Please sign in to comment.