Is it possible to pass on the error object returned by flickr api instead of just the error message
Longer version
This is the scenario I am seeing,
Node server exposes some API for accessing photos
Internally uses flickr.photos.* function get a particular photo
Gets a query for a photo that doesn't exists.
flickrapi throws an error which is then passed on to the client
Node has to check with the message and figure out what the error is instead of the code.
The issue in Step 4 is a error object is thrown with just the message instead of the actual error from flickr server. The error code could be easier reference to find the type of error to be passed on to the client.
We have flickr/methods/flickr.photos.*.json files that properly document the arguments and error response codes however when the error finally reaches the callback it is just the message instead of the response from flickr which includes {code, stat, message}. Would be nice if those could be exposed as well in addition to the error object.
If authors agrees for an additional config that will return error from flickr server in addition to the message, would gladly open a PR to add it :)
Note:
Sorry if this is already possible and I am just missing some config. Looked through the code and found flickrapi/src/utils.js:317. Noticed we get the error code, stat and message from flickr but in-turn create a error object with just the message and pass that from there on.
TL;DR
Longer version
This is the scenario I am seeing,
flickr.photos.*
function get a particular photoThe issue in Step 4 is a error object is thrown with just the message instead of the actual error from flickr server. The error code could be easier reference to find the type of error to be passed on to the client.
We have
flickr/methods/flickr.photos.*.json
files that properly document the arguments and error response codes however when the error finally reaches the callback it is just the message instead of the response from flickr which includes{code, stat, message}
. Would be nice if those could be exposed as well in addition to the error object.This is my setup,
If authors agrees for an additional config that will return error from flickr server in addition to the message, would gladly open a PR to add it :)
Note:
Sorry if this is already possible and I am just missing some config. Looked through the code and found
flickrapi/src/utils.js:317
. Noticed we get the error code, stat and message from flickr but in-turn create a error object with just the message and pass that from there on.