From abe74c4ac18e7aa84ef6c9dac7da9ac8991c18cf Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 19 Mar 2017 21:57:29 +0800 Subject: [PATCH] optimize dependency --- src/scripts/services/aria2RpcService.js | 4 +++- src/scripts/services/ariaNgCommonService.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts/services/aria2RpcService.js b/src/scripts/services/aria2RpcService.js index 8983439..e6b4448 100644 --- a/src/scripts/services/aria2RpcService.js +++ b/src/scripts/services/aria2RpcService.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('aria2RpcService', ['$q', 'aria2RpcConstants', 'aria2RpcErrors', 'ariaNgCommonService', 'ariaNgSettingService', 'aria2HttpRpcService', 'aria2WebSocketRpcService', function ($q, aria2RpcConstants, aria2RpcErrors, ariaNgCommonService, ariaNgSettingService, aria2HttpRpcService, aria2WebSocketRpcService) { + angular.module('ariaNg').factory('aria2RpcService', ['$q', 'aria2RpcConstants', 'aria2RpcErrors', 'ariaNgCommonService', 'ariaNgSettingService', 'ariaNgLogService', 'aria2HttpRpcService', 'aria2WebSocketRpcService', function ($q, aria2RpcConstants, aria2RpcErrors, ariaNgCommonService, ariaNgSettingService, ariaNgLogService, aria2HttpRpcService, aria2WebSocketRpcService) { var rpcImplementService = ariaNgSettingService.isUseWebSocket() ? aria2WebSocketRpcService : aria2HttpRpcService; var isConnected = false; var secret = ariaNgSettingService.getSecret(); @@ -112,6 +112,8 @@ return false; } + ariaNgLogService.error('[aria2RpcService.processError] ' + error.message, error); + if (aria2RpcErrors[error.message] && aria2RpcErrors[error.message].tipTextKey) { ariaNgCommonService.showError(aria2RpcErrors[error.message].tipTextKey); return true; diff --git a/src/scripts/services/ariaNgCommonService.js b/src/scripts/services/ariaNgCommonService.js index 8d2a667..657fe32 100644 --- a/src/scripts/services/ariaNgCommonService.js +++ b/src/scripts/services/ariaNgCommonService.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'SweetAlert', '$translate', 'ariaNgConstants', 'ariaNgLogService', function ($location, $timeout, base64, SweetAlert, $translate, ariaNgConstants, ariaNgLogService) { + angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'SweetAlert', '$translate', 'ariaNgConstants', function ($location, $timeout, base64, SweetAlert, $translate, ariaNgConstants) { return { generateUniqueId: function () { var sourceId = ariaNgConstants.appPrefix + '_' + Math.round(new Date().getTime() / 1000) + '_' + Math.random(); @@ -20,7 +20,6 @@ }, 100); }, showError: function (text) { - ariaNgLogService.info('[ariaNgCommonService.showError] ' + text); this.showDialog('Error', text, 'error'); }, showOperationSucceeded: function (text) {