Skip to content

Commit

Permalink
feat(errors): move errors and create new classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pxseu committed Oct 10, 2021
1 parent 00ab9dd commit 246660d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions src/lib/errors/Imperial/WrongPassword.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ImperialError } from "../ImperialError";

export class WrongPassword extends ImperialError {
constructor(...args: ConstructorParameters<typeof ImperialError>) {
super(...args);

this.message = "You need to provide a password, since this document is encrypted!";
this.status = 401;
}
}
5 changes: 3 additions & 2 deletions src/lib/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { DocumentNotFound } from "./HTTPErrors/DocumentNotFound";
export { NotAllowed } from "./HTTPErrors/NotAllowed";
export { DocumentNotFound } from "./Imperial/DocumentNotFound";
export { ImperialError } from "./ImperialError";
export { Aborted } from "./HTTPErrors/Aborted";
export { FailedToFetch } from "./HTTPErrors/FailedToFetch";
export { NotAllowed } from "./Imperial/EditNotAllowed";
export { WrongPassword } from "./Imperial/WrongPassword";

0 comments on commit 246660d

Please sign in to comment.