Browse Source

Improved API error debug info

TitanNano-voice_recorder
Igor Zhukov 11 years ago
parent
commit
c7f725a9e0
  1. 2
      app/js/lib/mtproto.js
  2. 2
      app/js/lib/mtproto_wrapper.js

2
app/js/lib/mtproto.js

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

2
app/js/lib/mtproto_wrapper.js

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

Loading…
Cancel
Save