Improve frontend error handling

This commit is contained in:
shamoon
2023-05-17 12:46:04 -07:00
parent c12c7c23fb
commit 4e295f0c71
7 changed files with 274 additions and 275 deletions

View File

@@ -13,6 +13,8 @@ export interface Toast {
actionName?: string
classname?: string
error?: any
}
@Injectable({
@@ -30,12 +32,13 @@ export class ToastService {
this.toastsSubject.next(this.toasts)
}
showError(content: string, delay: number = 10000) {
showError(content: string, delay: number = 10000, error: any = null) {
this.show({
title: $localize`Error`,
content: content,
delay: delay,
classname: 'error',
error,
})
}