Fix typing errors from the refactoring

This commit is contained in:
Matthew Raymer
2023-09-07 18:07:53 +08:00
parent 2fba7f2a55
commit 5b5c631001
3 changed files with 186 additions and 64 deletions

View File

@@ -221,9 +221,11 @@ export async function createAndSubmitGive(
return { type: "success", response };
} catch (error: unknown) {
const errorMessage: string =
error instanceof Error
error === null
? "Null error"
: error instanceof Error
? error.message
: typeof error === "object" && "message" in error
: typeof error === "object" && error !== null && "message" in error
? (error as { message: string }).message
: "Unknown error";