From f11e78dacb3bbf45988a5002bed3bf8e7f97d043 Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Mon, 17 Apr 2017 15:36:47 +0000
Subject: [PATCH] #3529 fix - Fixed cancel an delete commands on licenses

---
 securis/src/main/webapp/src/app/common/utils.ts |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/securis/src/main/webapp/src/app/common/utils.ts b/securis/src/main/webapp/src/app/common/utils.ts
index 25ce5d9..b60a4e4 100644
--- a/securis/src/main/webapp/src/app/common/utils.ts
+++ b/securis/src/main/webapp/src/app/common/utils.ts
@@ -1,6 +1,6 @@
 
 import { Component, Injectable, Input } from '@angular/core';
-import {LocaleService} from './i18n';
+import { LocaleService } from './i18n';
 import { Observable } from 'rxjs/Observable';
 
 
@@ -40,26 +40,23 @@
 @Injectable()
 export class BasicService {
 
-	constructor(protected $L: LocaleService) {}
+	constructor(protected $L: LocaleService) { }
 
-	public processErrorResponse(errorResponse: Response | any) {
-      // In a real world app, we might use a remote logging infrastructure
-      var error: IError = <IError>{};
-      if (errorResponse instanceof Response) {
+	public processErrorResponse(errorResponse: Response) {
+		// In a real world app, we might use a remote logging infrastructure
+		var error: IError = <IError>{};
 		error.httpCode = errorResponse.status;
-      }
+		error.code = errorResponse.headers.get(ERROR_CODE_MESSAGE_HEADER) || error.httpCode;
 
-	  error.code = errorResponse.headers.get(ERROR_CODE_MESSAGE_HEADER) || error.httpCode;
+		if (errorResponse.status === 403 /* forbidden */ || errorResponse.status === 401 /* unauthorized */) {
+			error.message = this.$L.get('Invalid credentials');
+			error.code = ErrorCodes.INVALID_CREDENTIALS;
+		} else if (errorResponse.status === 418 /* Teapot */) {
+			error.message = errorResponse.headers.get(ERROR_MESSAGE_HEADER) || errorResponse.statusText || this.$L.get('Unknown');
+		} else {
+			error.message = this.$L.get(`Unexpected error HTTP (${error.httpCode}) accessing to server. Contact with the administrator.`);
+		}
 
-      if (errorResponse.status === 403 /* forbidden */ || errorResponse.status === 401 /* unauthorized */) {
-        error.message = this.$L.get('Invalid credentials');
-		error.code = ErrorCodes.INVALID_CREDENTIALS;
-      } else if (errorResponse.status === 418 /* Teapot */) {
-        error.message = errorResponse.headers.get(ERROR_MESSAGE_HEADER) || errorResponse.statusText || this.$L.get('Unknown');
-      } else {
-        error.message = this.$L.get(`Unexpected error HTTP (${error.httpCode}) accessing to server. Contact with the administrator.`);
-      }
-
-      return Observable.throw(error);
-    }
+		return Observable.throw(error);
+	}
 }
\ No newline at end of file

--
Gitblit v1.3.2