Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShurakaiSoft committed Jun 2, 2015
1 parent 5577b27 commit 97465ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/send-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ var sendError = function (req, res, error) {

// handle each error
_.forEach(error, function A(error, index, collection) {
// This function is `A` as it's a "throwaway" (anonymous) function,
// but anonymous functions make stack traces harder to read. There
// exists a convention used by some (myself included) to name such
// "throwaway" functions with a single upper case letter, to make it
// clear that it's a throw away function.
// see: https://docs.npmjs.com/misc/coding-style for more info.

// log error if it's a 500 or strange error
if (!(error instanceof JSONAPI_Error) || (error instanceof JSONAPI_Error && error.error.status > 500))
Expand Down

0 comments on commit 97465ca

Please sign in to comment.