Skip to content

Commit

Permalink
Added ErrBlockNotFound error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvelmer committed Jul 8, 2024
1 parent 620dbc1 commit 3fbbe94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ErrAccountNotFound,
ErrAddressMalformed,
ErrAPI,
ErrBlockNotFound,
ErrCantParseElectionID,
ErrCantParsePayloadAsJSON,
ErrElectionFinished,
Expand Down Expand Up @@ -30,6 +31,8 @@ export abstract class API {
throw new ErrAccountNotFound(err['error']);
case 4006:
throw new ErrOrganizationNotFound(err['error']);
case 4008:
throw new ErrBlockNotFound(err['error']);
case 4017:
throw new ErrCantParseElectionID(err['error']);
case 4020:
Expand Down
6 changes: 6 additions & 0 deletions src/api/errors/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ export class ErrTransactionNotFound extends Error {
super(message ? message : 'transaction not found');
}
}

export class ErrBlockNotFound extends Error {
constructor(message?: string) {
super(message ? message : 'block not found');
}
}

0 comments on commit 3fbbe94

Please sign in to comment.