Whose Error Is It?

Ruby printed this

ActiveRecord::RecordNotFound: Couldn't find User with 'id'=42
What it meansA find call for a User with id 42 returned no row, and find raises an exception instead of returning nil when the record does not exist.
The first thing to checkConfirm the id exists in the database you are connected to; use find_by(id:) when missing records are expected, or rescue it and return a 404.

More from Ruby

All 75 errors

Whose Error Is It? · Status Menu · Back to the bar