Re: [Mojolicious] How to stop rendering after user error?

2016-12-01 Thread Alexbyk (subscriptions)
Actually, you're on the right way. But instead of calling render in controller (you'll get many duplicates of the same code), you better just leave only "die" there, and call render method from the hook. Smthng like this: # hook (you can also consider arount_action hook)

[Mojolicious] How to stop rendering after user error?

2016-12-01 Thread Peter Valdemar Mørch
Say in my controller I'm 5 levels deep and discover there is a problem with the user's input. I call: $c->render( template => 'errors/badValues', message => 'The value of foo cannot be "bar"', ); And now I want to stop the entire request right there. I guess the behaviour