feat: create error service to centralize the handling of errors
This commit is contained in:
parent
f4c17b9d36
commit
f334b68108
|
@ -0,0 +1,9 @@
|
||||||
|
// if you would like to add some logging or something similar, start here
|
||||||
|
|
||||||
|
export function throwError(error: any): void {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
throw new Error(error);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue