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

StackOverflow https://stackoverflow.com/questions/7024230

  •  15-12-2020
  •  | 
  •  

문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top