-
Notifications
You must be signed in to change notification settings - Fork 91
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW-1706] Refactoring of various error-related matters on SF #2871
Conversation
93a7ef7
to
c9dec98
Compare
c9dec98
to
9f8850c
Compare
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.
Feedback from testing:
-
resolve-friendly-url
script can hypothetically return any return code so I suggest taking this into account inmiddleware.ts
- I would respect the returned code and pass it inMIDDLEWARE_STATUS_CODE_KEY
. For 4XX codes, it can still return the message 'Friendly URL page not found' -
middleware.ts
- It is not safe to pass theJSON.stringify(e)
in theMIDDLEWARE_STATUS_MESSAGE_KEY
header as it might expose sensitive data. I would rather use thelogException
function. -
middleware.ts
- theJSON.stringify(e)
piece of code mentioned above does not work as expected - in the logs, I see justMiddleware runtime error ({}})
- but this should be probably resolved by the point above - It would be nice to describe the
logException
function in the documentation and motivate developers to use it
Hi, @sebaholesz, thanks for the fixes 馃憣 I noticed one more thing that might be addressed (but I do not insist on that, I suggest you discuss this with @pk16011990. We have the following code in
That means, even 410 errors (which now can be returned from the middleware) will be rendered as 500 error page. So the page currently looks like this: It is essential to mention that the HTTP code is correctly set to 410. - return statusCode === 404 ? <Error404Content /> : <Error500Content />;
+ const notFoundStatusCodes = [404, 410];
+ return notFoundStatusCodes.includes(statusCode) ? <Error404Content /> : <Error500Content />; However, the question is, what about the other status codes, do we want to care about them? 馃檪 |
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.
missing upgrade notes
371fc3d
to
91c2dbe
Compare
- previous state contained unnecessary duplicit logging and similar problems - it was also unclear where the problems are handled - the current code was stripped of unnecessary things and the behavior has been described in a new section of the docs
91c2dbe
to
afe0862
Compare
馃寪 Live Preview: