B4J Question How to reraise an exception?

Diceman

Active Member
Licensed User
I have a Try/Catch block that captures an exception and I log this error. But I want to reraise the exception because I don't want the code to continue executing. I want a top level try/catch block to handle the exception.

In Delphi I could catch the exception in the rtn where it occurred, log it, then execute a RAISE to reraise the same exception again, this time outside of the Try/Catch block so another Try/Catch block will handle it.

Can I accomplish this in B4X?
TIA
 

Jorge M A

Well-Known Member
Licensed User
Longtime User
Maybe this can be useful(?):
 
Upvote 0

Diceman

Active Member
Licensed User
Maybe this can be useful(?):

Yes I did see that. That article creates a central point to handle exceptions which is always a good idea. But in my case I needed to trap and handle the error in the rtn that caused it because that is where the local data is stored that caused the exception, then re-raise it if necessary to stop the program from continuing at that point.

Erel's solution https://www.b4x.com/android/forum/threads/threading-library.6775/ will work.
 
Upvote 0
Top