Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Rocket.Chat logging #15

Open
mobo4b opened this issue Jun 30, 2020 · 0 comments
Open

Improve Rocket.Chat logging #15

mobo4b opened this issue Jun 30, 2020 · 0 comments
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

Comments

@mobo4b
Copy link

mobo4b commented Jun 30, 2020

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):

catch (Exception ex) {
logService.logRocketChatError(
String.format("Rocket.Chat group with id %s could not be deleted", groupId), ex);
throw new RocketChatDeleteGroupException(ex);
}

and add a catch of HttpStatusCodeException before:

catch (HttpStatusCodeException httpStatusCodeException) {
// Get response body and detailed error description
// ...
// forward this information to own exception
// throw new ...;
}

@mobo4b mobo4b transferred this issue from Onlineberatung/onlineBeratung-userService Jul 15, 2020
@mobo4b mobo4b added backend Issue is related to/needs changes in the backend good first issue Good for newcomers help wanted Extra attention is needed labels Jul 15, 2020
@mobo4b mobo4b added messageservice Issue is related to/needs changes in the MessageService userservice Issue is related to/needs changes in the UserService labels Jul 29, 2020
amannn added a commit that referenced this issue Mar 21, 2022
feat: implement API call for getting tenant data
web-mi added a commit that referenced this issue Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant