Closed jonahkagan closed 11 years ago
Instead of constructing literal objects like { error: "message" }, have a function mk_error(message) that constructs an error object. That way we can easily extend it to have more info, codes, etc.
{ error: "message" }
mk_error(message)
Oh wait, actually, restify has a built in system for error handling. Let's use that.
http://mcavage.github.com/node-restify/#Error-handling
Instead of constructing literal objects like
{ error: "message" }
, have a functionmk_error(message)
that constructs an error object. That way we can easily extend it to have more info, codes, etc.