Closed natevw closed 11 years ago
n.b. currently Fermata does send Error("") objects, not just plain strings. need to review the conventions there for extending.
Added a .status
code property to the error created by the statusCheck plugin...beyond that not sure there's much built-in that would make sense to change, so closing this.
For most higher-level (e.g. JSON-translating) plugins success is success, but in case of error it may be nice to have a more Fermata-wide standard "error" object instead of just strings. E.g. in CouchDB a client may want to handle a 409 error quite differently than a 401 or a 500 or a socket-level error. Maybe something like:
As currently, the data field can still be (optionally) filled out with any information that could be extracted from the response body, although I suppose a plugin could perhaps tack that into its error object if desired. Main point being that error changes from being a "whatever" string to an object that at least has a numeric code distinct from message.