General refactoring
- Sometimes we write a debug log and not an error so that the logs are clearer, in some cases the error will be thrown later on with the exception as an error so there is no need to repeat it in a separate error log but in some cases we also might catch the error and not throw it later which means this error stays as a debug log and does not get shown as an error, how can we make sure this logic does not get too complicated?
- how can we always use the matrix alias instead of the room id in the logs without throwing exceptions and catching them later? this makes the code very complex.
- add an exit to the matrix client, just like it's done with the ldap client? Or maybe it's better to add the close of the ldap client to the finally?
- Don't catch and throw the same error, unless it has a different use case, otherwise just let it go directly to a general exception catching code block, usually there is no need to catch an error just to log something!
Edited by Friedlander Chagai