Ibm mobilefirst 注销MobileFirst调用过程';onFailure错误详细信息

Ibm mobilefirst 注销MobileFirst调用过程';onFailure错误详细信息,ibm-mobilefirst,mobilefirst-adapters,Ibm Mobilefirst,Mobilefirst Adapters,我们能捕获适配器调用失败错误的详细信息吗?示例代码: var invocationData = { adapter : 'UploadAdapter', procedure : 'uploadImage', parameters : [uuid, base64Str] }; WL.Client.invokeProcedure(invocationData, { onSuccess : uploadImageSuccess, onFailure : upl

我们能捕获适配器调用失败错误的详细信息吗?示例代码:

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

WL.Client.invokeProcedure(invocationData, {
    onSuccess : uploadImageSuccess,
    onFailure : uploadImageFail,
    timeout   : 60000,
});
我已经试过了:

function uploadImageFail(result){
    WL.Logger.debug(JSON.stringify(result);
}
但它只是:

{"invocationContext":null}

我的场景:我正在使用图像上传适配器(通过cordova),有时上传可能会失败。我可以很容易地捕获从后端服务返回的错误消息(在
uploadImageSuccess
函数中处理),但在调用过程出错时检索错误日志并不容易。

我不确定是否需要JSON。将其字符串化为
result
对象。相反,您可能只想使用
result.errorMsg

我也在谷歌上搜索过,它在需要使用的代码上产生了结果。。。因此,我将尝试以下文章中提供的选项:


result.errorMsg
起作用,即
运行时:Http请求失败:java.net.SocketTimeoutException:读取超时
。由于我们将图像编码为base64字符串(可能相当长),因此在调用上载适配器时经常发生此错误。