Browse Source

web-ui: Display default message on server errors without message

scalafmt-draft
Alexis Hernandez 7 years ago
parent
commit
d4fb33cf3b
  1. 1
      web-ui/src/app/app.component.ts
  2. 4
      web-ui/src/app/services/error.service.ts

1
web-ui/src/app/app.component.ts

@ -35,6 +35,7 @@ export class AppComponent {
// messages // messages
'message.serverUnavailable': 'The server unavailable, please try again in a minute', 'message.serverUnavailable': 'The server unavailable, please try again in a minute',
'message.unknownError': 'Unknown error, please try again in a minute',
// actions // actions
'action.find': 'Find', 'action.find': 'Find',

4
web-ui/src/app/services/error.service.ts

@ -33,8 +33,8 @@ export class ErrorService {
this.setFieldError(form, fieldName, message); this.setFieldError(form, fieldName, message);
} }
} else { } else {
const message = element.message; this.translateService.get(element.message || 'message.unknownErrors')
this.notificationService.error(message); .subscribe(msg => this.notificationService.error(msg));
} }
}); });
} }

Loading…
Cancel
Save