Skip to content

CHAT-53: Fixes to improve error messages from cloudflare.#55

Open
BravinR wants to merge 1 commit intomasterfrom
feature-CHAT-53-Fixes
Open

CHAT-53: Fixes to improve error messages from cloudflare.#55
BravinR wants to merge 1 commit intomasterfrom
feature-CHAT-53-Fixes

Conversation

@BravinR
Copy link
Collaborator

@BravinR BravinR commented Feb 19, 2025

Get very nice error messages. Throw less exceptions and make the client very happy.
image

Copy link
Collaborator

@Flanderzz Flanderzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix these and this should be good


} catch (ProfileImageException e) {
log.warn("File type not accepted: {}", request.getFile().getContentType());
return buildErrorResponse(HttpStatus.UNSUPPORTED_MEDIA_TYPE, "Profile picture type is not allowed!", "/signup");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this part, we have a global exception handler, and they get propagated from there as errors. i would move these or add the error handling to there.

} catch (Exception e) {
log.error("Unexpected error during signup process", e);
throw new UserException("Unexpected error during signup process");
return buildErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Unexpected error during signup process", "/signup");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants