Skip to content

Commit bb360a2

Browse files
committed
fix: show standard error message on project details page
In the PR #3335 the code was updated to show error details on the error page. But we have to show the standard error message. Also, we have to show error 404 in case of error 403 because server throws error 403 if page is not found. ref issue #3311
1 parent 6d74631 commit bb360a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/projects/detail/ProjectDetail.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ const showCoderBotIfError = (hasError) => {
4343
component = compose(
4444
withProps({code:403, message: messageGenerator})
4545
)
46-
} else if (props.error && props.error.code && props.error.msg) {
46+
// server always returns 403 when page is not found or user doesn't have access,
47+
// so 403 errors we don't customize and show `page404` instead
48+
} else if (props.error && props.error.code && props.error.code !== 403) {
4749
component = compose(
48-
withProps({code:props.error.code, message: props.error.msg})
50+
withProps({ code:props.error.code })
4951
)
5052
}
5153
return hasError(props)

0 commit comments

Comments
 (0)