From 8decdf1e40125f21c7dacc672cd5a9f9a1a927e8 Mon Sep 17 00:00:00 2001 From: enoch-danijel Date: Sun, 19 Nov 2023 18:46:22 +0100 Subject: [PATCH] created new error handlers --- errors/api.error.ts | 3 +++ errors/index.ts | 6 ++++++ errors/web3.error.ts | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 errors/api.error.ts create mode 100644 errors/web3.error.ts diff --git a/errors/api.error.ts b/errors/api.error.ts new file mode 100644 index 0000000..5d3755c --- /dev/null +++ b/errors/api.error.ts @@ -0,0 +1,3 @@ +export async function APIERROR() { + return "ERROR OCCURRED WHEN FETCHING DATA"; +} diff --git a/errors/index.ts b/errors/index.ts index 027b005..d729c22 100644 --- a/errors/index.ts +++ b/errors/index.ts @@ -1 +1,7 @@ export * from "./login.error"; +export * from "./api.error"; +export * from "./web3.error"; + +export async function GenericError(msg: string) { + console.log(`API ERROR: ${msg}`); +} diff --git a/errors/web3.error.ts b/errors/web3.error.ts new file mode 100644 index 0000000..6c3bd74 --- /dev/null +++ b/errors/web3.error.ts @@ -0,0 +1,3 @@ +export async function WEB3ERROR() { + return "Blockchain error occured"; +}