2
Vote

XrmServiceToolkit.Rest.errorHandler should not throw Exception

description

Hi,

because errorHandler function "throws new Error(...)" the errorCallback function will never be called.
E.g. you can test it with an invalid $select query:
AccountSet?$select=NonExistingField
The errorHandler should "return new Error(...)" for correct errorCallback function execution.
Would you think the same way?

Best Regards,
Francis

comments

Fr4ncis wrote Sep 21, 2015 at 3:58 PM

Hi,

short note:
Of corse the main problem are not logical errors (like invalid $select fields) during development, but rather runtime errors (errors from CRM if length limit is exceeded, errors from plugins on create/update are thrown, and so on, ...).
On synchronous requests you have a chance to catch the Exception, but unfortunately not on asynchronous requests.

Best Regards,
Francis

wrote Feb 25, 2016 at 7:57 PM

wwilson wrote Feb 25, 2016 at 7:59 PM

this has actually caused a few of our scripts to fail miserably in Chrome because the "error" isn't returned, just thrown.