-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
When privacy policies doc is malformed, treat it as a 404 instead of some custom error. #9527
- Loading branch information
1 parent
01d06ec
commit fd83165
Showing
5 changed files
with
44 additions
and
10 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,19 @@ | ||
class PublicError extends Error { | ||
constructor(publicMessage, ...args) { | ||
super(publicMessage, ...args); | ||
this.publicMessage = publicMessage; | ||
} | ||
} | ||
|
||
class NotFoundError extends Error { | ||
constructor(message, ...args) { | ||
super(message, ...args); | ||
this.status = 404; // simulate PouchDb error | ||
this.statusCode = 404; // simulate Request error | ||
} | ||
} | ||
|
||
module.exports = { | ||
PublicError, | ||
NotFoundError, | ||
}; |
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
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