-
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.
fix: show users 404 when a non existing package is scanned
This is in order to show 404 for missing packages and not 500
- Loading branch information
AviadHahami
committed
Dec 8, 2020
1 parent
47eaff9
commit 9b26e2b
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { CustomError } from './custom-error'; | ||
|
||
export class NonExistingPackageError extends CustomError { | ||
private static ERROR_CODE = 404; | ||
private static ERROR_MESSAGE = "Couldn't find the requested package"; | ||
|
||
constructor() { | ||
super(NonExistingPackageError.ERROR_MESSAGE); | ||
this.code = NonExistingPackageError.ERROR_CODE; | ||
this.userMessage = NonExistingPackageError.ERROR_MESSAGE; | ||
} | ||
} |
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