Skip to content

feat: Log error details when task parameters are invalid - #1581

Merged
abbiemery merged 1 commit into
mainfrom
log-422
Jul 1, 2026
Merged

abbiemery merged 1 commit into
mainfrom
log-422

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@tpoliaw
tpoliaw requested a review from a team as a code owner June 30, 2026 09:03
@tpoliaw tpoliaw linked an issue Jun 30, 2026 that may be closed by this pull request
@tpoliaw
tpoliaw requested a review from DominicOram June 30, 2026 09:04
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.93%. Comparing base (32c57b9) to head (2ee4b56).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1581   +/-   ##
=======================================
  Coverage   95.93%   95.93%           
=======================================
  Files          44       44           
  Lines        3270     3271    +1     
=======================================
+ Hits         3137     3138    +1     
  Misses        133      133           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for the quick fix! The message that is logged is good, just disagree about the level. Will approve assuming that you increase the level.

for err in e.errors()
]

LOGGER.info("Error submitting task: %s - %s", task_request, e)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: info seems low. I would say at least warn, maybe even error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really an error from blueapi's perspective if the user provided invalid input. Happy to see what others think though

@ZohebShaikh ZohebShaikh Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a client error but a server info so I agree with Peter that it should only be logged as info on server side.

This is similar to how fastapi handles a request which has correct syntax but wrong instruction, and we are sending the correct response for it 422 same as fastapi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I think it will make support slightly easier if it's error but I'm not that fussed as long as the information is there

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge it for now, but if it proves to be frustrating on the user side we can change it

@abbiemery
abbiemery added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 4c5b567 Jul 1, 2026
20 checks passed
@abbiemery
abbiemery deleted the log-422 branch July 1, 2026 12:55
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.

Better logging on 422 errors

4 participants