mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-02 05:23:21 +00:00
add catch error with check for known error
This commit is contained in:
3
util.ts
3
util.ts
@@ -21,3 +21,6 @@ export const errorCode = (code: number, error: string) => ({
|
||||
});
|
||||
export const error = (error: string) => ({ error });
|
||||
export const ok = { result: null };
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export const isKnownError = (e: any): e is T.KnownError => e.error || e["error-code"]
|
||||
Reference in New Issue
Block a user