etn-ccis/blui-angular-workflows

Easy Custom Dialog Errors

Closed this issue · 1 comments

Describe the desired behavior

Allow users to easily provide string content to display for an error dialog's title and content.

Describe the current behavior

There's not an easy way for users to provide custom error messages into our Dialog components when an error happens. They have to provide their own DialogService which toggles their own CustomErrorDialogComponent.

Is this request related to a current issue?

No

Potential fix:

Example of handling an error when a login attempt fails, turn this:

.catch(() => {
this._pxbLoginErrorDialogService.openDialog();

into this:

.catch((errorContent: { title: string, message: string }) => {
this._pxbLoginErrorDialogService.openDialog(errorContent);

This way a user can reject a Promise with the appropriate error content. If no content is provided, we just use our default error messages.

This updated logic would go in the end-user's implementation of the AuthService.