Add data to NoMethodError for progress #42982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've had an error on
/dashboardapi/section_level_progress/<section>
which has been increasing in frequency over the last few months:The error is
NoMethodError: undefined method []=' for nil:NilClass
, which I determined would be caused for a bubble choice level if a student does not have overall progress for the level but has progress on a sublevel. It's hard for me to imagine how this could happen. I reloaded the endpoint with the same parameters that it failed with and got 200s. I logged in as various teachers looking for a pattern that could be causing this among their student progress with no luck.I need more data. So I've rescued the error and re-raised it with more information about the specific student and level.
Links
Error: https://app.honeybadger.io/projects/3240/faults/80852799/01FHX8JY4SPJER77W141CNQ155
Testing story
I've tested locally that raising the error results in the expected message:
Follow-up work
Once I have more data, I'll look into the specific levels and students that this is happening for.
PR Checklist: