-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
#45 Pass url while creating 404 error message #46
Conversation
Lets say I've received an 404 error in Universal router . And I'm trying to debug the Url that caused the error, I cant see the url as while creating the error we are not passing the URL
So we have been using universal router at production with https://github.com/kriasoft/react-starter-kit. In error page we are trying to log the error URL , but saw it's never being passed . With this change that issue is solved. I tested it . can you kindly merge. |
|
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.
This will be backward compatible, more helpfull and safer:
if (result === undefined && errorRoute) {
const error = new Error('Not found');
error.status = 404;
error.context = { ...context };
context.error = error;
return await errorRoute.action(context, {});
}
And please, add test if possible
not sure why it's backwork compatible and our solution wasn't. all i know is ours was tested and live on one of india's largest ecommerce On 7 Oct 2016 4:34 a.m., "Pavel Lang" notifications@github.com wrote:
|
I think this error should tightly follow HTTP status codes. Additional info should not be part of message |
Lets say I've received an 404 error in Universal router . And I'm trying to debug the Url that caused the error, I cant see the url as while creating the error we are not passing the URL