JohnC Expert Licensed User Longtime User Nov 7, 2018 #1 When looking in the example code for the new Camera2 tutorial, I found this code in the Starter Service: Code: Copy 'Return true to allow the OS default exceptions handler to handle the uncaught exception. Sub Application_Error (Error As Exception, StackTrace As String) As Boolean Log("Application_Error") Log(Error) Log(StackTrace) Return False End Sub Shouldn't the last line always be "Return True" so that the OS will handle the error? I ask because all the "Log(xx)" lines will only be helpful when the Phone is connected to the IDE, and these lines will post the info to the log window regardless if the last line is "Return False" or "Return True". But, wouldn't we want to always do a "Return True" here so that the error is properly handled when run on a user's device?
When looking in the example code for the new Camera2 tutorial, I found this code in the Starter Service: Code: Copy 'Return true to allow the OS default exceptions handler to handle the uncaught exception. Sub Application_Error (Error As Exception, StackTrace As String) As Boolean Log("Application_Error") Log(Error) Log(StackTrace) Return False End Sub Shouldn't the last line always be "Return True" so that the OS will handle the error? I ask because all the "Log(xx)" lines will only be helpful when the Phone is connected to the IDE, and these lines will post the info to the log window regardless if the last line is "Return False" or "Return True". But, wouldn't we want to always do a "Return True" here so that the error is properly handled when run on a user's device?
Jeffrey Cameron Well-Known Member Licensed User Longtime User Nov 7, 2018 #2 It depends on what you want to have happen. See: https://www.b4x.com/android/forum/threads/uncaught-exceptions.59805/#content Upvote 0
It depends on what you want to have happen. See: https://www.b4x.com/android/forum/threads/uncaught-exceptions.59805/#content