Skip to content

Commit

Permalink
Added ErrOrganizationNotFound error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvelmer committed Jul 5, 2024
1 parent 27a2894 commit 940da1e
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 @@ -10,6 +10,7 @@ import {
ErrElectionNotStarted,
ErrFaucetAlreadyFunded,
ErrNoElectionKeys,
ErrOrganizationNotFound,
} from './errors';

export abstract class API {
Expand All @@ -27,6 +28,8 @@ export abstract class API {
throw new ErrAddressMalformed(err['error']);
case 4003:
throw new ErrAccountNotFound(err['error']);
case 4006:
throw new ErrOrganizationNotFound(err['error']);
case 4017:
throw new ErrCantParseElectionID(err['error']);
case 4020:
Expand Down
6 changes: 6 additions & 0 deletions src/api/errors/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ export class ErrAccountNotFound extends Error {
super(message ? message : 'account not found');
}
}

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

0 comments on commit 940da1e

Please sign in to comment.