-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Redirect to 404 Page When Note is Not Found #277
base: main
Are you sure you want to change the base?
Changes from 4 commits
f7aff4a
ad06c92
c88dc16
4316fc4
c6b4cf1
4d54a4c
55bc4e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import DomainError from './Base'; | ||
|
||
/** | ||
* Domain error thrown when unknown error occurs | ||
*/ | ||
export default class ApiError extends DomainError { | ||
/** | ||
Comment on lines
+3
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think, that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, currently it is not needed, I had created the ApiError to consider it as default error, to check api error response is instance of ApiError or not, |
||
* Constructor for ApiError error | ||
* @param message - Error message | ||
* @param statusCode - Error status code | ||
*/ | ||
constructor(message: string, public statusCode: number) { | ||
super(message); | ||
this.name = 'ApiError'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 page was actually needed (this was a syntax for each unexpected url, that would show 404
page not found
)we need to create separate /error page, that should have
statusCode
property and show different info by different status codeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also better to use route.params for
code
prop