Improved errors in mtproto

This commit is contained in:
Igor Zhukov 2014-08-05 14:59:53 +01:00
parent 98da2bbea4
commit f40627faae

View File

@ -214,7 +214,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
var msg_len = deserializer.fetchInt('msg_len'); var msg_len = deserializer.fetchInt('msg_len');
} catch (e) { } catch (e) {
return $q.reject({code: 406, type: 'NETWORK_BAD_RESPONSE', problem: e.message, stack: e.stack}); return $q.reject({code: 406, type: 'NETWORK_BAD_RESPONSE', originalError: e});
} }
rng_seed_time(); rng_seed_time();
@ -223,7 +223,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
}, },
function (error) { function (error) {
if (!error.message && !error.type) { if (!error.message && !error.type) {
error = {code: 406, type: 'NETWORK_BAD_REQUEST'}; error = {code: 406, type: 'NETWORK_BAD_REQUEST', originalError: error};
} }
return $q.reject(error); return $q.reject(error);
} }