List Info

Thread: Redirecting to error action/method




Redirecting to error action/method
user name
2006-12-06 17:23:22
Hi list!

In Nitro 0.31 and earlier all errors raised was
automatically redirected 
to the error action/method . In 0.40, this doesn't work. My
error method 
never get called, some kind of default error page appears
instead. Any 
hints on how to fix this?


Sincerely

/lasso

-- 
________________________________________
Lars Olsson
lassolassoweb.se
http://www.lassoweb.se/
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-06 18:00:23
Hi,

> In Nitro 0.31 and earlier all errors raised was
automatically redirected
> to the error action/method . In 0.40, this doesn't
work. My error method
> never get called, some kind of default error page
appears instead. Any
> hints on how to fix this?

This still happens with Oxy which also has a custom error
page.

I don't have an error action, only a `error.xhtml` in my
template root dir
though.  Maybe that does the trick?

Jo

-- 
Feel the love
http://pinkjuice.c
om/pics/ruby.png
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-06 18:44:27
Thanks Jonathan! It was actually a coding error on my part
that caused 
the strange effect I saw.

<mad ramblings
aimed_at="no_one_in_particular">
WHY WHY WHY is Nitro::NoActionError renamed to
Nitro::ActionError 
WITHOUT A BIG SIGN declaring the change in the release
notes??? Now I 
hade to go through the darcs changelog to find
out...Important API 
changes need to be documented better!!!
</mad ramblings>

/lasso

Jonathan Buch skrev:
> Hi,
> 
>> In Nitro 0.31 and earlier all errors raised was
automatically redirected
>> to the error action/method . In 0.40, this doesn't
work. My error method
>> never get called, some kind of default error page
appears instead. Any
>> hints on how to fix this?
> 
> This still happens with Oxy which also has a custom
error page.
> 
> I don't have an error action, only a `error.xhtml` in
my template root dir
> though.  Maybe that does the trick?
> 
> Jo
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-06 19:08:30
Hi,

> Thanks Jonathan! It was actually a coding error on my
part that caused
> the strange effect I saw.
>
> <mad ramblings
aimed_at="no_one_in_particular">
> WHY WHY WHY is Nitro::NoActionError renamed to
Nitro::ActionError
> WITHOUT A BIG SIGN declaring the change in the release
notes??? Now I
> hade to go through the darcs changelog to find
out...Important API
> changes need to be documented better!!!
> </mad ramblings>

Ayyy... I feel partly responsible for that I guess.  ^^;

But actually neither George nor I had forseen this internal
error be
used outside of dispatcher.rb and render.rb I guess....

Jo

-- 
Feel the love
http://pinkjuice.c
om/pics/ruby.png
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-06 19:42:46
Hi!

I actually use it in two kinds of situations:

1. Custom error handler

def error
     error, path = context.rendering_errors[0]
     if error.kind_of?(Nitro::ActionError)
         # Tell user page doesn't exist
     else
         # Tell user an internal error occurred
         # Additional actions (logging etc)
     end
end

2. A simple way to "hide" pages from unauthorized
users

def some_action
     if some_condition
         # Allow user to see page
     else
         raise Nitro::ActionError.new
     end
end


Kindly

/lasso


Jonathan Buch skrev:
> Hi,
> 
>> Thanks Jonathan! It was actually a coding error on
my part that caused
>> the strange effect I saw.
>>
>> <mad ramblings
aimed_at="no_one_in_particular">
>> WHY WHY WHY is Nitro::NoActionError renamed to
Nitro::ActionError
>> WITHOUT A BIG SIGN declaring the change in the
release notes??? Now I
>> hade to go through the darcs changelog to find
out...Important API
>> changes need to be documented better!!!
>> </mad ramblings>
> 
> Ayyy... I feel partly responsible for that I guess. 
^^;
> 
> But actually neither George nor I had forseen this
internal error be
> used outside of dispatcher.rb and render.rb I guess....
> 
> Jo
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-06 20:13:57
Hi,

> I actually use it in two kinds of situations:
>
> 1. Custom error handler
> 2. A simple way to "hide" pages from
unauthorized users

I hope you hacks there is going to vanish when George gets
around
implementing my error handling idea.  ;D
Well, or at least something similar (I will pester George
more about
this, since I like the idea).  :P

Jo

-- 
Feel the love
http://pinkjuice.c
om/pics/ruby.png
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-07 09:55:25
Will do it for 0.42.0, I need this feature   urgently for my
own projects too 

-g.

On 12/6/06, Jonathan Buch <johnoxyliquit.de> wrote:
> Hi,
>
> > I actually use it in two kinds of situations:
> >
> > 1. Custom error handler
> > 2. A simple way to "hide" pages from
unauthorized users
>
> I hope you hacks there is going to vanish when George
gets around
> implementing my error handling idea.  ;D
> Well, or at least something similar (I will pester
George more about
> this, since I like the idea).  :P
>
> Jo
>
> --
> Feel the love
> http://pinkjuice.c
om/pics/ruby.png
> _______________________________________________
> Nitro-general mailing list
> Nitro-generalrubyforge.org
> h
ttp://rubyforge.org/mailman/listinfo/nitro-general
>


-- 
http://cull.gr
http://www.joy.gr
http://blog.gmosx.com
http://nitroproject.org
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Redirecting to error action/method
user name
2006-12-07 10:58:11
Hi,

> Will do it for 0.42.0, I need this feature   urgently
for my own projects too 

lol, don't feel pressured, feel free to think of another way
to do this. ;)

Jo

_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )