Skip to main content

All Questions

3 votes
2 answers
131 views

Spring boot shop application with error handling

I'm writing a simple online shop using spring boot, for learning purposes. Right now I have purchasing-service and a product-service. The purchasing-service makes requests to the product-service via ...
Eoin's user avatar
  • 263
1 vote
1 answer
3k views

Spring boot: better way to handle response and exceptions

I am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it ...
benjamin c's user avatar
5 votes
0 answers
1k views

Exception handling: using @JsonProperty value to make error message

If the validation in RestController fails, I need to handle MethodArgumentNotValidException and provide an errorMessage, that ...
Georgii Lvov's user avatar
1 vote
1 answer
181 views

In Spring framework, should the controller let the client know that something went wrong by returning a response entity with the proper error code?

Category Service: ...
Alexandros Kourtis's user avatar
3 votes
1 answer
336 views

Java: Only log first error occurrence (with hourly reset)

I have a redis caching server. If that caching server is down, my app will query the database directly. I want to know from the logs if my caching server is not reachable. However, if I add a log ...
TeaCup's user avatar
  • 181
0 votes
2 answers
59 views

Printing the status of a database insertion as JSON

The controller is currently inserting a record into the database and returning a JSON response as shown below in the try-catch block. I can see the ...
John's user avatar
  • 195
1 vote
1 answer
165 views

Spring API that performs RSA encryption with exception handling [closed]

I'm creating a rest api using Spring which utilize javax.crypto as library to do some encryption stuff. While everything works well, I'm curious whether the error handling like this is acceptable or ...
imeluntuk's user avatar
  • 223
3 votes
2 answers
247 views

Throw exception in Spring when loading a file

I have this following piece of code: ...
Manuelarte's user avatar
4 votes
2 answers
263 views

Property file loader

I have the following code: ...
Eugene Ustimenko's user avatar
5 votes
1 answer
6k views

Handling an invalid SQL query exception

This is my DAO object that takes the Cypher query as a string, and returns a JSON representation of the graph it returns. Because it's using a Spring JdbcTemplate ...
dwjohnston's user avatar
  • 1,348
3 votes
1 answer
3k views

Managing data access layer exceptions

I am developing a webapp using Spring MVC + Hibernate. I created a GenericDao class that implements basic data access methods, to be extended by all my concrete daos in the app. What I want advice or ...
MichelReap's user avatar