File: Awful.pm

package info (click to toggle)
libcatalyst-action-rest-perl 1.21-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 476 kB
  • sloc: perl: 1,750; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package Test::Serialize::View::Awful;

use base Catalyst::View;

sub render {
  my ($self, $c, $template) = @_;
  die "I don't know how to do that!";
}

sub process {
  my ($self, $c) = @_;

  my $output = eval {
    $self->render($c, "blah");
  };

  if ($@) {
    my $error = qq/Couldn't render template. Error: "$@"/;
    $c->error($error);
    return 0;
  }

  $c->res->body($output);
  return 1;
}

1;