generated from defi-wonderland/ts-turborepo-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# 🤖 Linear Closes GIT-221 ## Description We make all custom exception on the project to extend Retriable or NonRetriable base errors classes Also, we create some new exceptions where needed ## Checklist before requesting a review - [x] I have conducted a self-review of my code. - [x] I have conducted a QA. - [ ] If it is a core feature, I have included comprehensive tests.
- Loading branch information
Showing
44 changed files
with
809 additions
and
268 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
packages/chain-providers/src/exceptions/dataDecode.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class DataDecodeException extends Error { | ||
import { NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class DataDecodeException extends NonRetriableError { | ||
constructor(message: string) { | ||
super(message); | ||
this.name = "DataDecodeException"; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
packages/chain-providers/src/exceptions/invalidArgument.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class InvalidArgumentException extends Error { | ||
import { NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class InvalidArgumentException extends NonRetriableError { | ||
constructor(message: string) { | ||
super(message); | ||
this.name = "InvalidArgumentException"; | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
packages/chain-providers/src/exceptions/multicallNotFound.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/chain-providers/src/exceptions/rpcUrlsEmpty.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class RpcUrlsEmpty extends Error { | ||
import { NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class RpcUrlsEmpty extends NonRetriableError { | ||
constructor() { | ||
super("RPC URLs array cannot be empty"); | ||
this.name = "RpcUrlsEmpty"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/data-flow/src/exceptions/invalidChangeset.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
packages/indexer-client/src/exceptions/indexerClientError.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class IndexerClientError extends Error { | ||
constructor(message: string) { | ||
super(`Indexer client error - ${message}`); | ||
this.name = "IndexerClientError"; | ||
import { ErrorContext, NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class IndexerClientError extends NonRetriableError { | ||
constructor(message: string, context?: ErrorContext, error?: Error) { | ||
super(`Indexer client error - ${message}`, context, error); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
packages/indexer-client/src/exceptions/invalidIndexerResponse.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class InvalidIndexerResponse extends Error { | ||
import { NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class InvalidIndexerResponse extends NonRetriableError { | ||
constructor(response: string) { | ||
super(`Indexer response is invalid - ${response}`); | ||
this.name = "InvalidIndexerResponse"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class InvalidCidException extends Error { | ||
import { NonRetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class InvalidCidException extends NonRetriableError { | ||
constructor(cid: string) { | ||
super(`Invalid CID: ${cid}`); | ||
this.name = "InvalidCidException"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export class UnknownPricingException extends Error { | ||
constructor(message: string, stack?: string) { | ||
super(message); | ||
this.stack = stack; | ||
import { ErrorContext, RetriableError } from "@grants-stack-indexer/shared"; | ||
|
||
export class UnknownPricingException extends RetriableError { | ||
constructor(message: string, context: ErrorContext) { | ||
super(message, context); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
packages/pricing/src/exceptions/unsupportedToken.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { TokenCode } from "@grants-stack-indexer/shared"; | ||
import { ErrorContext, NonRetriableError, TokenCode } from "@grants-stack-indexer/shared"; | ||
|
||
export class UnsupportedToken extends Error { | ||
constructor(tokenCode: TokenCode) { | ||
super(`Unsupported token: ${tokenCode}`); | ||
export class UnsupportedToken extends NonRetriableError { | ||
constructor(tokenCode: TokenCode, context: ErrorContext) { | ||
super(`Unsupported token: ${tokenCode}`, context); | ||
} | ||
} |
Oops, something went wrong.