Improve Rocket.Chat logging #15
Labels
backend
Issue is related to/needs changes in the backend
good first issue
Good for newcomers
help wanted
Extra attention is needed
messageservice
Issue is related to/needs changes in the MessageService
userservice
Issue is related to/needs changes in the UserService
Does the proposed refactoring task solve a problem, reduce complexity or even improve performance? Please describe.
The logging in the RocketChatService class is too rough and needs to be improved to see more details of the Rocket.Chat API response on failures. The whole class RocketChatService.java needs to be improved.
Describe the solution you'd like
The schema is always the same. For example in lines 211+ we catch a general exception, log an error message and throw our own exception which just forwards the first exception. When catching an HttpStatusCodeException we can get the response body of the Rocket.Chat API call and with this get more detailled information of what failed exactly within the call. Also we need to remove the redundant logging (remove the logService.logRocketChatError method calls and forward detailled logging information to the self-implemented RocketChat[...]Exception.
Describe alternatives you've considered
No alternatives considered yet.
Additional context
Remove the redundant logging (logService):
and add a catch of HttpStatusCodeException before:
The text was updated successfully, but these errors were encountered: