Hello,
The Sunit-Debugger does a stack search on startup to find the test related exception.
It might be good to do it better, especially as the debug process starts from the exception
I might be a good idea to actually keep a reference to it.
Would there be any downside of Exception>>debug passing a reference to the Debugger?
�� �� �� �� Marcus
> On 2 Feb 2018, at 17:19, Peter Uhn��k <i.uhnak@gmail.com> wrote:
>
> Hi,
>
> is there a way to install a global handler for exceptions?
>
> Right now if I want to log all exceptions, I use approach from ShoreLine and create a PreDebugAction which is activated when any "unhandled" exception occurs.
>
> That would be good enough, however the Debugger has zero knowledge of the exception that is actually occuring, as Exception>>debug passes on only the title. So if I want to get back to the original exception and maybe log it with beacon, I need to do a lot of stack and context shenanigans:
>
> MyPreDebugAction>>logException
>�� �� �� ��MyLogger
>�� �� �� �� �� �� �� ��runDuring: [ (debugger session interruptedProcess suspendedContext stack
>�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��detect: [ :context | context receiver isKindOf: Exception ]) receiver emit ]
>
>
> Is there a better way to approach this?
>
> Thanks,
> Peter