Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UserError exception type to separate server vs user errors #241

Closed
wants to merge 3 commits into from

Conversation

nikochiko
Copy link
Member

Q/A checklist

  • Do a code review of the changes
  • Add any new dependencies to poetry & export to requirementst.txt (poetry export -o requirements.txt)
  • Carefully think about the stuff that might break because of this change
  • The relevant pages still run when you press submit
  • If you added new settings / knobs, the values get saved if you save it on the UI
  • The API for those pages still work (API tab)
  • The public API interface doesn't change if you didn't want it to (check API tab > docs page)
  • Do your UI changes (if applicable) look acceptable on mobile?

finish_reason = FinishReason.USER_ERROR
traceback.print_exc()
sentry_sdk.capture_exception(e)
error_msg = err_msg_for_exc(e)
Copy link
Member

Choose a reason for hiding this comment

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

Just do error_msg = str(e)

# increment total time taken after every iteration
run_time += time() - start_time
save()
except UserError as e:
Copy link
Member

Choose a reason for hiding this comment

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

except UserError,pydantic.ValidationError

@@ -31,6 +31,12 @@
EPOCH = datetime.datetime.utcfromtimestamp(0)


class FinishReason(models.IntegerChoices):
Copy link
Member

Choose a reason for hiding this comment

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

Either change this to be ErrorReason, or save RecipeRunState in db

@devxpy devxpy closed this Mar 19, 2024
@nikochiko nikochiko deleted the better-errors branch May 30, 2024 12:38
@nikochiko nikochiko restored the better-errors branch May 30, 2024 12:38
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.

2 participants