-
Notifications
You must be signed in to change notification settings - Fork 303
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
Frontend Error Handling #667
Conversation
if (error) { | ||
return 'ERROR' | ||
return <FullViewError error={error} /> |
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.
According to this comment #659 (comment) we want to avoid this, right?
namely:
We would then have to use portals to be able to show full page errors. Otherwise, we could only display within the boundaries of the dom that the component is rendered into. E.g. in case of 404 of an entity we would still have to show the sidebar, which is not what we want. And even with portals, it would still render unnecessarily, unless we add logic to prevent that.
pkg/webui/lib/errors/utils.js
Outdated
) | ||
|
||
/** | ||
* Returns wether the error has a shape that is well-known |
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.
misleading comment imo
according to the comment i would expect the function to return true
when the error shape is well-known
'407': 'Proxy Authentication Required', | ||
'408': 'Request Timeout', | ||
'409': 'Conflict', | ||
'410': 'Gone', |
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.
Do we really want to have this?
I dont see how the user can benefit from seeing Gone
in the error view.
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.
I have removed all status codes here that do not have a connected grpc error.
fb631e4
to
a91ba36
Compare
@@ -12,21 +12,31 @@ | |||
// See the License for the specific language governing permissions and |
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 is wrongfully labeled as moved file by github 🤷♂.
} | ||
|
||
ErrorView.propTypes = { | ||
ErrorComponent: PropTypes.element.isRequired, |
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.
causes:
Warning: Failed prop type: Invalid prop `ErrorComponent` of type `function` supplied to `ErrorView`, expected a single ReactElement.
in ErrorView (created by ConsoleApp)
in ConsoleApp (created by WithEnv(ConsoleApp))
in WithEnv(ConsoleApp) (created by Route)
in Route (created by withRouter(WithEnv(ConsoleApp)))
in withRouter(WithEnv(ConsoleApp)) (created by Console)
in SideNavigationProvider (created by Console)
in BreadcrumbsProvider (created by Console)
in Router (created by ConnectedRouter)
in ConnectedRouter (created by Connect(ConnectedRouter))
in Connect(ConnectedRouter) (created by Console)
in IntlProvider (created by UserLocale)
in UserLocale (created by WithEnv(UserLocale))
in WithEnv(UserLocale) (created by Connect(WithEnv(UserLocale)))
in Connect(WithEnv(UserLocale)) (created by Console)
in Init (created by Connect(Init))
in Connect(Init) (created by Console)
in Provider (created by Console)
in EnvProvider (created by Console)
in Console
@@ -129,6 +138,8 @@ Header.propTypes = { | |||
action: PropTypes.func, | |||
icon: PropTypes.string, | |||
})), | |||
/** Flag identifying whether links should be rendered as plain anchor link */ | |||
anchored: PropTypes.bool, |
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.
user: state.user.user, | ||
})) | ||
@bind | ||
export default class Header extends Component { |
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.
proptypes missing
@@ -24,7 +24,7 @@ import Icon from '../../../components/icon' | |||
import DateTime from '../../../lib/components/date-time' | |||
import Message from '../../../lib/components/message' | |||
import Button from '../../../components/button' | |||
import { isNotFoundError, isErrorTranslated } from '../../../lib/errors' | |||
import { isNotFoundError, isTranslated } from '../../../lib/errors/utils' |
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.
isNotFoundError
throws TypeError
when creating a new gateway
<Route path={`${match.path}/add`} component={ApplicationCollaboratorAdd} /> | ||
<Route path={`${match.path}/:collaboratorId`} component={ApplicationCollaboratorEdit} /> | ||
</Switch> | ||
<ErrorView ErrorComponent={SubViewError}> |
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.
ErrorView
is not imported to the file. causes ReferenceError
1581eb0
to
79be69b
Compare
eeb4dd6
to
d9a114e
Compare
d9a114e
to
7c9584b
Compare
Summary
This PR adds a start for handling errors in the console / oauth app.
Closes #41
Closes #659
Changes
<ErrorMessage />
component to use new error utilsPAGE_DATA
errors in both console and oauthNotes for Reviewers
Using this approach, we can throw errors from anywhere in the render tree and have them handled by the nearest error boundary. I believe the exact granularity of where to place error boundaries will be figured out by us as we go. Also, the exact content of the error views needs to be adapted by us later based on user feedback and progressive insight. The overall goal should be to hint the user towards problem resolution whenever possible.
Otherwise:
<Init />
-component but I decided to do this more explicitly for now