Skip to content

Kenan revan dev#71

Open
kenanqafarov wants to merge 22 commits intoironhack-labs:mainfrom
kenanqafarov:kenan-revan-dev
Open

Kenan revan dev#71
kenanqafarov wants to merge 22 commits intoironhack-labs:mainfrom
kenanqafarov:kenan-revan-dev

Conversation

@kenanqafarov
Copy link
Copy Markdown

No description provided.

@ExceptionHandler(Exception.class)
public ResponseEntity<String> handleGenericException(Exception ex) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("An unexpected error occurred: " + ex.getMessage());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's a super specific comment but considering your good project submission here it goes:
Since this is a catch-all exception handler, I’d avoid returning whatever comes from getMessage() to the client.
It can still leak internal details like DB messages, file paths, or implementation-specific errors. A generic message for the response plus proper server-side logging would be safer. Something like: "An unexpected error occurred".

Added with a logging of the error, obviously, but this part is just informative. Not to implement.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for pointing that out! We missed it this time, but we'll make sure to pay closer attention from now on.

@ahpoise
Copy link
Copy Markdown

ahpoise commented Mar 12, 2026

You decided to not have patch mappings. Right?
In fact your puts are actually behaving in a somewhat similar way to a patch. What's the rationale behind it?

@kenanqafarov
Copy link
Copy Markdown
Author

You decided to not have patch mappings. Right? In fact your puts are actually behaving in a somewhat similar way to a patch. What's the rationale behind it?

You’re right! We actually split the workload between us, and since we hadn't implemented PATCH logic yet, we focused on customizing our PUT methods. This allowed us to achieve the same result for partial updates while keeping our workflow moving forward during the development phase.

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.

3 participants