meteorhacks / npm

Complete NPM integration for Meteor
http://meteorhacks.com/complete-npm-integration-for-meteor.html
MIT License
508 stars 43 forks source link

Custom error #113

Open shotleybuilder opened 8 years ago

shotleybuilder commented 8 years ago

Hi Just wondering how to return a custom error. From the Docs "If the callback has a result, it will be returned from the wrapped function. If there is an error, it will be thrown" The custom error returned from apiCall is ignored and the wrapper throws a code 500. Which on the client is interpreted as "internal server error". How to get access to the error from apiCall?

    var response = Async.wrap(apiCall)(apiUrl);
    var jsonResult = Async.wrap(Meteor.myFunctions.parsingXML)(response.content); 
    return jsonResult;