You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Use find_by instead of find and gracefully handle the error. find would raise an Active Record Not Found error when a record is not found and would get caught by Rollbar this happens when users try to resource which does not exist, whereas find_by would return nil without raising an error but nil need to handled.
To Reproduce
Steps to reproduce the behavior:
Go to course curriculum or show page which does not exist. school.localhost/courses/:id
It will raise Active Record Not Found
It will get caught by Rollbar.
Expected behavior
Use find_by and gracefully handle the error
The text was updated successfully, but these errors were encountered:
From rollbar error
Describe the bug
Use
find_by
instead offind
and gracefully handle the error.find
would raise anActive Record Not Found
error when a record is not found and would get caught by Rollbar this happens when users try to resource which does not exist, whereasfind_by
would returnnil
without raising an error but nil need to handled.To Reproduce
Steps to reproduce the behavior:
school.localhost/courses/:id
Expected behavior
Use
find_by
and gracefully handle the errorThe text was updated successfully, but these errors were encountered: