The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Perl::Critic::Policy::TryTiny::RequireCatch - Always include a "catch" block when using "try"

VERSION

version 0.003

DESCRIPTION

Programmers from other programming languages may assume that the following code does not swallow exceptions:

    use Try::Tiny;
    try {
        # ...
    }
    finally {
        # ...
    };

However, Try::Tiny's implementation always swallows exceptions unless a catch block has been specified.

The programmer should always include a catch block. The block may be empty, to indicate that exceptions are deliberately ignored.

    use Try::Tiny;
    try {
        # ...
    }
    catch {
        # ...
    }
    finally {
        # ...
    };

This policy assumes that Try::Tiny is being used, and it doesn't run if it can't find it being imported.

CONFIGURATION

This Policy is not configurable except for the standard options.

AUTHOR

David D Lowe <flimm@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Lokku <cpan@lokku.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.