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
'message.serverUnavailable': 'The server unavailable, please try again in a minute',
'message.unknownError': 'Unknown error, please try again in a minute',
// actions
'action.find': 'Find',

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

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

Loading…
Cancel
Save