3 role CatalystX::Declare::Action::CatchValidationError {
7 around execute (Object $controller, Object $ctx, @rest) {
9 my $tc = $controller->meta->find_method_type_constraint($self->name)
11 my $method = $controller->meta->find_method_by_name($self->name);
12 ( $_ = $method->can('type_constraint') )
17 if ($tc and my $error = $tc->validate([$controller, $ctx, @rest])) {
20 $ctx->error("BAD REQUEST: $error");
23 $ctx->response->body( 'Not found' );
24 $ctx->response->status( 404 );
31 $self->$orig($controller, $ctx, @rest);