Mojo::Template::Exception(3p)

NAME
Mojo::Template::Exception - Template Exception

SYNOPSIS
    use Mojo::Template::Exception;
    my $e = Mojo::Template::Exception->new;

DESCRIPTION
Mojo::Template::Exception is a container for template exceptions.

ATTRIBUTES
Mojo::Template::Exception implements the following attributes.

  "line"
    my $line = $e->line;
    $e       = $e->line([3, 'foo']);

  "lines_after"
    my $lines = $e->lines_after;
    $e        = $e->lines_after([[1, 'bar'], [2, 'baz']]);

  "lines_before"
    my $lines = $e->lines_before;
    $e        = $e->lines_before([[4, 'bar'], [5, 'baz']]);

  "message"
    my $message = $e->message;
    $e          = $e->message('oops!');

  "stack"
    my $stack = $e->stack;
    $e        = $e->stack([['Foo::Bar', '/foo/bar.pl', 23]]);

METHODS
Mojo::Template::Exception inherits all methods from Mojo::Base and implements the following new ones.

  "new"
    my $e = Mojo::Loader::Exception->new('Oops!', $template);

  "parse_context"
    $e = $e->parse_context($lines, $line);

  "to_string"
    my $string = $e->to_string;
    my $string = "$e";