开发者

Monorails. Although I use Rescue attributes, 500 "Error processing action" is still thrown

开发者 https://www.devze.com 2023-03-27 01:43 出处:网络
In my 开发者_开发百科monorails project. I use attribute Rescue [Rescue(\"generalerror\", typeof(System.Exception))]

In my 开发者_开发百科monorails project. I use attribute Rescue

[Rescue("generalerror", typeof(System.Exception))]

but the error 500 "Error processing action" still is thrown. How can I hide it?


Hm, do you have a view called "generalerror.vm" or equivalent? (.vm is NVelocity suffix).

If you don't specify ExceptionType, then it will catch it for all exceptions as well, so you don't need to specify it explicitly.

If your rescue is on a separate controller, then you need this syntax:

[Rescue( typeof( RescueController ), "Index" )]

Where "Index" is the action on RescueController that would be invoked upon failure.


Make sure have view called "generalerror" place it in Views/Rescues

0

精彩评论

暂无评论...
验证码 换一张
取 消