Improved API error debug info

This commit is contained in:
Igor Zhukov 2014-10-22 16:29:10 +04:00
parent c335156be5
commit c7f725a9e0
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
transformRequest: null
});
} catch (e) {
requestPromise = $q.reject(e);
requestPromise = $q.reject({code: 406, type: 'NETWORK_BAD_RESPONSE', originalError: e});
}
return requestPromise.then(
function (result) {

View File

@ -108,7 +108,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
if (!options.noErrorBox) {
error.input = method;
error.stack = error.stack || (new Error()).stack;
error.stack = error.originalError && error.originalError.stack || error.stack || (new Error()).stack;
setTimeout(function () {
if (!error.handled) {
ErrorService.show({error: error});