I inherited a code base that uses a compiled logging library. I cannot update the logging library. This library has a method that registers details for an exception. The method takes one exception as a parameter. Now I am creating a mobile application that will be attached to this system.
In this mobile application, I have a block of code that handles uncaught exceptions. I need to register them on the server. But now I can transfer data over the network in a lowercase format. Because of this, I have a service that accepts an error message, a stack trace and different lines. I need to take these lines and convert them to Exception so that I can pass them to my preexisting library.
How can I take a message and stackTrace as strings and bind them to Exception? The task here is Message and StackTrace are read-only.
Thanks!
source share