request.exception when using async controller

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

request.exception when using async controller

Robert Fletcher-2
When using a regular controller if an exception is thrown then a request.exception property is available to the view, however if I update the controller to use grails.async.Promises.tasks then no such property is available. Is this intentional / unavoidable or is there some way to get hold of the exception?

Rob
Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

smaldini
If you were using grails-events with grails (which change the underlying Promises.tasks to create Reactor Promises) you could attach an exception callback but I am not sure with the default.


On Mon, Jan 6, 2014 at 10:52 PM, Robert Fletcher <[hidden email]> wrote:
When using a regular controller if an exception is thrown then a request.exception property is available to the view, however if I update the controller to use grails.async.Promises.tasks then no such property is available. Is this intentional / unavoidable or is there some way to get hold of the exception?

Rob



--
Stéphane
--

Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

Robert Fletcher-2
I don't understand why the asynchronous nature of the controller is really an issue since the view is only rendered when the promise is resolved – i.e. as far as the view itself is concerned there's no difference from a regular controller action.


On Tue, Jan 7, 2014 at 10:14 AM, Stephane Maldini <[hidden email]> wrote:
If you were using grails-events with grails (which change the underlying Promises.tasks to create Reactor Promises) you could attach an exception callback but I am not sure with the default.


On Mon, Jan 6, 2014 at 10:52 PM, Robert Fletcher <[hidden email]> wrote:
When using a regular controller if an exception is thrown then a request.exception property is available to the view, however if I update the controller to use grails.async.Promises.tasks then no such property is available. Is this intentional / unavoidable or is there some way to get hold of the exception?

Rob



--
Stéphane
--


Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

Robert Fletcher-2
In reply to this post by Robert Fletcher-2
Generally it seems like this is something that could do with being documented. I’ve tried explicitly rendering an error view using the .onError callback on the PromiseMap created by Promises.tasks but all I’m getting is a blank page. I can see the exception is being passed to the callback but the render doesn’t seem to work.

Without using .onError I eventually get the error view rendered but the exception is not available.

If I use Promises.task instead of Promises.tasks I don’t even get that.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

Graeme Rocher-2
Hi Rob,

This seems like a bug, please raise a JIRA

Thanks


On Wed, Jan 8, 2014 at 12:44 AM, Robert Fletcher <[hidden email]> wrote:
Generally it seems like this is something that could do with being documented. I’ve tried explicitly rendering an error view using the .onError callback on the PromiseMap created by Promises.tasks but all I’m getting is a blank page. I can see the exception is being passed to the callback but the render doesn’t seem to work.

Without using .onError I eventually get the error view rendered but the exception is not available.

If I use Promises.task instead of Promises.tasks I don’t even get that.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Graeme Rocher
Grails Project Lead
SpringSource
Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

Robert Fletcher-2
Do you mean specifically the rendering issue?


On Thu, Jan 9, 2014 at 10:53 AM, Graeme Rocher <[hidden email]> wrote:
Hi Rob,

This seems like a bug, please raise a JIRA

Thanks


On Wed, Jan 8, 2014 at 12:44 AM, Robert Fletcher <[hidden email]> wrote:
Generally it seems like this is something that could do with being documented. I’ve tried explicitly rendering an error view using the .onError callback on the PromiseMap created by Promises.tasks but all I’m getting is a blank page. I can see the exception is being passed to the callback but the render doesn’t seem to work.

Without using .onError I eventually get the error view rendered but the exception is not available.

If I use Promises.task instead of Promises.tasks I don’t even get that.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Graeme Rocher
Grails Project Lead
SpringSource

Reply | Threaded
Open this post in threaded view
|

Re: request.exception when using async controller

Robert Fletcher-2
I've raised http://jira.grails.org/browse/GRAILS-10976 with a simple example of both problems: 1) no exception available in error view if thrown in async task 2) error view rendered in onError callback doesn't seem to work (I may be misunderstanding what I need to do, though).


On Fri, Jan 10, 2014 at 4:05 PM, Robert Fletcher <[hidden email]> wrote:
Do you mean specifically the rendering issue?


On Thu, Jan 9, 2014 at 10:53 AM, Graeme Rocher <[hidden email]> wrote:
Hi Rob,

This seems like a bug, please raise a JIRA

Thanks


On Wed, Jan 8, 2014 at 12:44 AM, Robert Fletcher <[hidden email]> wrote:
Generally it seems like this is something that could do with being documented. I’ve tried explicitly rendering an error view using the .onError callback on the PromiseMap created by Promises.tasks but all I’m getting is a blank page. I can see the exception is being passed to the callback but the render doesn’t seem to work.

Without using .onError I eventually get the error view rendered but the exception is not available.

If I use Promises.task instead of Promises.tasks I don’t even get that.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Graeme Rocher
Grails Project Lead
SpringSource