Skip to content

Provide more information in error log by logging request body for val…#724

Open
KushanSingh-Kalvium wants to merge 1 commit into
aiondemand:developfrom
KushanSingh-Kalvium:provide-more-info-error-log
Open

Provide more information in error log by logging request body for val…#724
KushanSingh-Kalvium wants to merge 1 commit into
aiondemand:developfrom
KushanSingh-Kalvium:provide-more-info-error-log

Conversation

@KushanSingh-Kalvium

Copy link
Copy Markdown

Change(s)

Change Type: Changed

Change Category: Internal

Changelog Entry:
Improve error logging for asset uploads by including the request body
in the logged error information.

Previously, the error log displayed ""
because the request body stream had already been consumed when the
exception handler executed.

This change introduces a helper function that safely retrieves the
request body and includes it in the log output. The logging behavior
has also been extended to handle both HTTPException and
RequestValidationError, ensuring that request data is available in
logs for debugging upload failures.

How to Test

  1. Run the test suite:
    pytest src/tests/test_error_response.py

  2. Verify that:

  • Error logs contain the request body instead of
    "".
  • Validation errors and HTTP exceptions both log request body data.

Checklist

  • Tests have been added or updated to reflect the changes.
  • Documentation updates are not required.
  • A self-review has been conducted.
  • All CI checks pass.

Related Issues

Closes #485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide more information in error log

1 participant