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
One thing that we were lacking was actually logging any errors which
occurred with a JSON api endpoint. This simply cargo cults, copies, the
logic that Rails already uses for errors. The logic has changed slightly
for Rails 5, but since we are not targeting that just yet we'll stick
with the latest Rails 4.2.6 version.
We need to log the error before we render the JSON as our middleware's
return value from `call` is used as the response. There isn't much
special to note about the logging itself. All of the complex logic comes
from Rails, mostly to ensure it focuses on app related errors, stripping
out Rails framework details, when possible.
0 commit comments