Hi Mathias !
I'm new to madExcept and I don't know if your package allow me to do what I want... I have designed a multi-threaded console server application which is connected to a database. Sometimes, exceptions are raised by the database driver... As I used a lot of try..finally...end / try...except...end code patterns, exceptions are handled correctly and error messages are displayed on the console, but to be able to decide if something goes really wrong in my code I have to know which function has raised the exception. In a nutshell, I need a stack trace.
I know that madExcept can do that, but the real matter is "how to call the function which generates the stack trace". Should I modify all my try..except...blocks in order to call the function which creates the stack trace in order to display it on the user's screen ?
Is there a mean to call a generic function *each time* an exception is raised in order to display the stack trace ? A kind of proc which would be called prior to all "except" or "finally" events handlers of my application... For instance, I cannot use MadExceptionHandler.OnException since exceptions are caught inside the try/except/blocks.
Hope I have been clear enough
Best regards,
A.R.
Stack trace question (newbie)
-
- Posts: 4
- Joined: Sat Feb 18, 2006 9:46 am
- Location: France
You have 3 choices:
(1) Either manually invoke madExcept in every try..except statement.
(2) Or redesign your exception management to use less try..except blocks.
(3) Or use "RegisterHiddenExceptionHandler".
http://help.madshi.net/madExceptUnit.ht ... ionHandler
Please note that calculating a stack trace does cost some time. So if your program raises exceptions very often, calculating a stack trace everytime will slow your program down.
(1) Either manually invoke madExcept in every try..except statement.
(2) Or redesign your exception management to use less try..except blocks.
(3) Or use "RegisterHiddenExceptionHandler".
http://help.madshi.net/madExceptUnit.ht ... ionHandler
Please note that calculating a stack trace does cost some time. So if your program raises exceptions very often, calculating a stack trace everytime will slow your program down.
-
- Posts: 4
- Joined: Sat Feb 18, 2006 9:46 am
- Location: France