[Trunk|Library]: errorMessages.component: in 'getErrorCode' function add case when status is number (not string).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55247 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-04-09 18:40:45 +00:00
parent 02fe5fb13e
commit e09abdaeb0
1 changed files with 6 additions and 6 deletions

View File

@ -60,16 +60,16 @@ import {ErrorCodes} from './properties/errorCodes';
}
}
public getErrorCode(status: string) {
if(status == '401') {
public getErrorCode(status: any) {
if(status == '401' || status == 401) {
return this.errorCodes.FORBIDDEN;
} else if(status == "403") {
} else if(status == "403" || status == 403) {
return this.errorCodes.FORBIDDEN;
} else if(status == "204") {
} else if(status == "204" || status == 204) {
return this.errorCodes.NONE;
} else if(status == '404') {
} else if(status == '404' || status == 404) {
return this.errorCodes.NOT_FOUND;
} else if(status == '500') {
} else if(status == '500'|| status == 500) {
return this.errorCodes.ERROR;
} else {
return this.errorCodes.NOT_AVAILABLE;