How to show the errors produced when a SUEvaluator is used ?

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

How to show the errors produced when a SUEvaluator is used ?

Burella Juan M.
Hello all.

When I use a SUEvaluator and an error occurs, an the error isn't rendered, whereas with a SUUpdater works properly. How to show the errors produced when a SUEvaluator is used ?

Here is the code to reproduce the problem

renderContentOn: aRenderer
   
    aRenderer select
        list: #(2 1 4 5 6);
        selected: 1;
        id: 'updaterList';
        callback: [ self error: 'an unexpected error' ]; "Show the error report"
        onChange: (aRenderer updater
                                id: 'show';
                                triggerFormElement: 'updaterList';
                                callback: [ :r | r html: 'hello' ]).
   
        aRenderer select
            list: #(2 1 4 5 6);
            selected: 1;
            id: 'evaluatorList';
            callback: [ self error: 'an unexpected error' ];
            onChange:  (aRenderer evaluator
                                triggerFormElement: 'evaluatorList';
                                callback: [ :r | r element id: 'show';
                                                    update: [ : rr| rr html: 'hello'] ]).   
       
        aRenderer div id: 'show'; with: ''


I'm using Seaside2.8a1-pmm.577 and   Scriptaculous-lr.242

Thanks in advance.
Juan M.

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to show the errors produced when a SUEvaluator is used ?

Lukas Renggli
>  When I use a SUEvaluator and an error occurs, an the error isn't rendered,
> whereas with a SUUpdater works properly. How to show the errors produced
> when a SUEvaluator is used ?

I assume you are already using FireBug.

SUEvaluator should open a debugger in your image, but in this case the
form callbacks are not caught (only the primary callback). Can you
file a bug-report on this. SUUpdater normally renders in some way to
the page, but this is not visible in all cases.

It is a difficult problem, because Seaside cannot know what the user
wants to do with the generated output. I guess using something like
FireBug is the only feasible solution. In the log of FireBug you
immediately see any problems.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to show the errors produced when a SUEvaluator is used ?

Burella Juan M.
Lukas, thank you very much for your response.

On Thu, Oct 9, 2008 at 3:54 AM, Lukas Renggli <[hidden email]> wrote:
>  When I use a SUEvaluator and an error occurs, an the error isn't rendered,
> whereas with a SUUpdater works properly. How to show the errors produced
> when a SUEvaluator is used ?

I assume you are already using FireBug.

SUEvaluator should open a debugger in your image, but in this case the
form callbacks are not caught (only the primary callback). Can you
file a bug-report on this. SUUpdater normally renders in some way to
the page, but this is not visible in all cases.

It is a difficult problem, because Seaside cannot know what the user
wants to do with the generated output.

I would like to replace the contents of the tag body with the error report. Something like:

...
[ "proceses callback" ]
      on: Error 
      do: [ : err | aScript element 
id: (SUStream on: 'document.body');
update:  [: render |  self reportError: err on: render ] ]
...
 
It is possible?

I guess using something like
FireBug is the only feasible solution. In the log of FireBug you
immediately see any problems.

Yes, I use it, but the problem is that I cannot inform users that an error has occurred
 

Cheers,
Lukas

Regards
Juan M
 

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to show the errors produced when a SUEvaluator is used ?

Lukas Renggli
> I would like to replace the contents of the tag body with the error report.
> Something like:
>
> ...
> [ "proceses callback" ]
>       on: Error
>       do: [ : err | aScript element
>  id: (SUStream on: 'document.body');
>  update:  [: render |  self reportError: err on: render ] ]
> ...
>
> It is possible?

Sure, that might work in your specific case. I am not sure, if this is
something that makes sense in all applications.

> > I guess using something like
> > FireBug is the only feasible solution. In the log of FireBug you
> > immediately see any problems.
>
> Yes, I use it, but the problem is that I cannot inform users that an error
> has occurred

The event #onFailure: or one of the others might help here.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to show the errors produced when a SUEvaluator isused ?

Sophie424
"Lukas Renggli" <[hidden email]> wrote in message

> Sure, that might work in your specific case. I am not sure, if this is
> something that makes sense in all applications.

Could it be a good default, since the error is at least made visible?

- Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside