Updates angular-bwc and new error messages

This commit is contained in:
Gustavo Maximiliano Cortez 2015-08-05 10:44:29 -03:00
commit 12d132c37a
2 changed files with 5 additions and 5 deletions

View file

@ -17,7 +17,7 @@
"ng-lodash": "~0.2.0", "ng-lodash": "~0.2.0",
"angular-moment": "~0.10.1", "angular-moment": "~0.10.1",
"moment": "~2.10.3", "moment": "~2.10.3",
"angular-bitcore-wallet-client": "^0.0.28", "angular-bitcore-wallet-client": "^0.1.1",
"angular-ui-router": "~0.2.13", "angular-ui-router": "~0.2.13",
"qrcode-decoder-js": "*", "qrcode-decoder-js": "*",
"fastclick": "*", "fastclick": "*",

View file

@ -400,9 +400,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.handleError = function(err) { self.handleError = function(err) {
$log.warn('Client ERROR:', err); $log.warn('Client ERROR:', err);
if (err.code === 'NOTAUTHORIZED') { if (err.code === 'NOT_AUTHORIZED') {
$scope.$emit('Local/NotAuthorized'); $scope.$emit('Local/NotAuthorized');
} else if (err.code === 'NOTFOUND') { } else if (err.code === 'NOT_FOUND') {
$scope.$emit('Local/BWSNotFound'); $scope.$emit('Local/BWSNotFound');
} else { } else {
$scope.$emit('Local/ClientError', (err.error ? err.error : err)); $scope.$emit('Local/ClientError', (err.error ? err.error : err));
@ -960,12 +960,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
$rootScope.$on('Local/ClientError', function(event, err) { $rootScope.$on('Local/ClientError', function(event, err) {
if (err.code && err.code === 'NOTAUTHORIZED') { if (err.code && err.code === 'NOT_AUTHORIZED') {
// Show not error, just redirect to home (where the recreate option is shown) // Show not error, just redirect to home (where the recreate option is shown)
go.walletHome(); go.walletHome();
} else if (err && err.cors == 'rejected') { } else if (err && err.cors == 'rejected') {
$log.debug('CORS error:', err); $log.debug('CORS error:', err);
} else if (err.code === 'ETIMEDOUT' || err.code === 'CONNERROR') { } else if (err.code === 'ETIMEDOUT' || err.code === 'CONNECTION_ERROR') {
$log.debug('Time out:', err); $log.debug('Time out:', err);
} else { } else {
var msg = 'Error at Wallet Service: '; var msg = 'Error at Wallet Service: ';