Debugging exceptions (continuations are mandatory, aren't they?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugging exceptions (continuations are mandatory, aren't they?)

GLASS mailing list
Hi guys, 

In my application, I have some error handler at some point (#on:do:) and I kept the exception instance somewhere. Later, I would like to open a Seaside debugger on it using WAGemStoneContinuationDebugger.

I am already currently using WAGemStoneContinuationDebugger but for "unhandled errors" that end up in the seaside error handler and hence I create a continuation. Therefore, I end up sending #initializeWithContinuation:  to WAGemStoneContinuationDebugger.

In this case I am talking now, I only have the exception, no continuation. So I tried something like this:

| comp |
comp := WAGemStoneContinuationDebugger new.
comp initializeWithException: anException.
html anchor 
     callback: [self call: comp];
     with: 'Debug'

The stack is indeed rendered. But the problem is that the "stack" I see on it, is the stack associated to the rendering of the link... (and everything before that link..that is..the rendering of the app). There is nothing on the stack related to the "anException".  

To solve this, what I had to do, is to create a continuation in my error handler block and store the continuation as well as the original exception. And then use #initializeWithContinuation:  instead of #initializeWithException:. 

Is this expected?

Thanks in advance, 


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Debugging exceptions (continuations are mandatory, aren't they?)

GLASS mailing list


On 03/01/2016 07:08 AM, Mariano Martinez Peck via Glass wrote:
Hi guys, 

In my application, I have some error handler at some point (#on:do:) and I kept the exception instance somewhere. Later, I would like to open a Seaside debugger on it using WAGemStoneContinuationDebugger.

I am already currently using WAGemStoneContinuationDebugger but for "unhandled errors" that end up in the seaside error handler and hence I create a continuation. Therefore, I end up sending #initializeWithContinuation:  to WAGemStoneContinuationDebugger.

In this case I am talking now, I only have the exception, no continuation. So I tried something like this:

| comp |
comp := WAGemStoneContinuationDebugger new.
comp initializeWithException: anException.
html anchor 
     callback: [self call: comp];
     with: 'Debug'

The stack is indeed rendered. But the problem is that the "stack" I see on it, is the stack associated to the rendering of the link... (and everything before that link..that is..the rendering of the app). There is nothing on the stack related to the "anException".  

To solve this, what I had to do, is to create a continuation in my error handler block and store the continuation as well as the original exception. And then use #initializeWithContinuation:  instead of #initializeWithException:. 

Is this expected?
Yes ... WAGemStoneContinuationDebugger inherits from WAGemStoneWalkback and when you use #initializeWtihException: you are triggering the WAGemStoneWalkback behavior ... presumably there should be a #shouldNotImplement in WAGemStoneContinuationDebugger>>initializeWithException: ... bot cases end up sending #initializeWithContext: where all of the action happens ... with a Exception passed in the context is created from the current process and with a continuation the context is created from the continuation ..

Dale

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass