I've noticed that uncaught custom exceptions in managed packages aren't recorded in the debug log if it's thrown in the context of the Salesforce UI or Lightning community. The exception message can be seen in the Salesforce UI and in the Lightning community (by retrieving the message from the error object after a server-side call). However, if the custom exception is invoked directly from the dev console by via anonymous apex, it's recorded in the debug log. This seems to be a bug of the Salesforce platform. Is there a workaround for this other than using a custom object for logging errors?