When using zalando's problem-spring-web library, how can I make sure any internal server error does not send the details to the frontend? For example, instead of
"title": "Internal Server Error",
"status": 500,
"detail": "For input string: \"string\"; nested exception is java.lang.NumberFormatException: For input string: \"string\""
}
I want to send
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected error occurred."
}
You can add add any exception type in your controller advice, ever your custom exception types. If you can add status and detail in your custom exception type, you can set the error response information.