REST CRUD errorcallback

Sep 30, 2015 at 12:44 AM
Edited Sep 30, 2015 at 12:46 AM
Hi,

My error callback never gets called. Can you please help me?
Snippet from examples in documentation:
XrmServiceToolkit.Rest.Create(
    account,
    "AccountSet",
    function (result) {
        accountId = result.AccountId;
    },
    function (error) {
        alert(error.message);
    },
    false
);
Should I put in errorHandler function return new Error, instead of throw new Error?

Best regards,
Nov 12, 2015 at 11:51 AM
This appears to be a bug in the current version of XrmServiceToolkit. As you say, the method "errorHandler" (around line 584) THROWS an error when it ought to just RETURN the error. I just changed this in my local version of XrmServiceToolkit.

This bug appears newly introduced. In earlier versions of XrmServiceToolkit, the error is returned correctly and not thrown.