-
Notifications
You must be signed in to change notification settings - Fork 5
Create feedback #601
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
Create feedback #601
Conversation
|
What issue does this relate to? |
danhalson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but a couple of suggestions and questions here...happy to discuss in a call if that's easier 😄
lib/concepts/feedback/create.rb
Outdated
| response | ||
| rescue StandardError => e | ||
| Sentry.capture_exception(e) | ||
| if response[:feedback].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by this, would it maybe be better to be checking is .errors is not empty first and doing the join, and then falling back to this? but maybe I'm misunderstanding something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this - I've simplified it, as I think that check isn't really needed. It was catching the error that was being thrown separately below, but I think we can just allow it to try and save with the school project id being nil and get the error in the normal way through that
Just linked to the ticket in the description |
lib/concepts/feedback/create.rb
Outdated
| response | ||
| rescue StandardError => e | ||
| Sentry.capture_exception(e) | ||
| errors = response[:feedback]&.errors&.full_messages&.join(',') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my worry here now is that it could fail to return an error if it's not a validation error, which won't be an array...so I think the fallback was good, it maybe wasn't explicit enough about what it was doing
danhalson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Status
Related to https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/928
Overall epic is https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/944
What's changed?