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

fix: Set error value from validation exception properly for feature seralizer #3809

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

zachaysan
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

To access the string value of an exception the proper way is to call str() on the exception itself, not referencing .message so this code updates the call.

How did you test this code?

I manually tested a try and except prototype to mimic the behaviour.

Copy link

sentry-io bot commented Apr 19, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: api/features/serializers.py

Function Unhandled Issue
save AttributeError: 'ValidationError' object has no attribute 'message' /api/v1/environments/{environment_api_key}/identities/{identity_pk}/...
Event Count: 1
save AttributeError: 'ValidationError' object has no attribute 'message' /api/v1/features/...
Event Count: 1

Did you find this useful? React with a 👍 or 👎

@zachaysan zachaysan requested a review from matthewelwell April 19, 2024 12:46
Copy link

vercel bot commented Apr 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:48am
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:48am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:48am

Copy link
Contributor

github-actions bot commented Apr 19, 2024

Uffizzi Preview deployment-50494 was deleted.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.93%. Comparing base (e138b4e) to head (895d8fa).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3809   +/-   ##
=======================================
  Coverage   95.93%   95.93%           
=======================================
  Files        1103     1103           
  Lines       34801    34801           
=======================================
  Hits        33386    33386           
  Misses       1415     1415           

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

@zachaysan zachaysan added this pull request to the merge queue Apr 19, 2024
Merged via the queue into main with commit 18d8214 Apr 19, 2024
24 checks passed
@zachaysan zachaysan deleted the fix/set_from_validation_exception branch April 19, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants