0
votes

Can we just catch the adapter calling failure error details? sample code :

var invocationData = {
    adapter : 'UploadAdapter',
    procedure : 'uploadImage',
    parameters : [uuid, base64Str]
};

WL.Client.invokeProcedure(invocationData, {
    onSuccess : uploadImageSuccess,
    onFailure : uploadImageFail,
    timeout   : 60000,
});

I've already tried this:

function uploadImageFail(result){
    WL.Logger.debug(JSON.stringify(result);
}

But it was just:

{"invocationContext":null}

My scenario : I'm working on an image uploading adapter (via cordova), and sometimes the uploading may fail. I can easily catch the error message returned from the backend service (which is handled in the uploadImageSuccess function), but it's not easy to retrieve the error logs when the invoking procedure goes wrong.

1

1 Answers

0
votes

I am not sure you need to JSON.stringify it the result object. Instead you may want to simply use result.errorMsg.

I also googled, and it produced results on the code that needs to be used... so I would try the options provided in the following articles: