view release on metacpan or search on metacpan
author:
- 'Mateu X Hunter <hunter@missoula.org>'
build_requires:
English: 0
Test::More: 0
Try::Tiny: 0
configure_requires:
ExtUtils::MakeMaker: 6.31
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
license: perl
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
TAP::Harness::Env 0
TOML 0.95
Term::ANSIColor 0
Text::MicroTemplate 0.20
Time::Piece 1.16
Try::Tiny 0
parent 0
perl 5.008005
version 0
Module-Build-0.4211
pathname: L/LE/LEONT/Module-Build-0.4211.tar.gz
cpanfile.snapshot view on Meta::CPAN
Module::Implementation 0.07
requirements:
Carp 0
ExtUtils::MakeMaker 6.30
Module::Runtime 0.012
Try::Tiny 0
strict 0
warnings 0
Module-Metadata-1.000026
pathname: E/ET/ETHER/Module-Metadata-1.000026.tar.gz
provides:
cpanfile.snapshot view on Meta::CPAN
Test::More 0
perl 5.00800
Try-Tiny-0.22
pathname: D/DO/DOY/Try-Tiny-0.22.tar.gz
provides:
Try::Tiny 0.22
requirements:
Carp 0
Exporter 5.57
ExtUtils::MakeMaker 6.30
constant 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chess/PGN/Extract.pm view on Meta::CPAN
use Data::Dump qw| dump |;
use Encode qw| encode_utf8 |;
use IO::Handle;
use JSON::XS qw| decode_json |;
use Sys::Cmd qw| spawn |;
use Try::Tiny;
sub read_games {
my $pgn = shift;
my %opts = @_;
# TODO: add options to be passed to pgn-extract
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chouette.pm view on Meta::CPAN
But with both of these methods, what should the callback do when it is notified of an error? It can't just C<die> because nothing will catch the exception. With the L<EV> event loop you will see this:
EV: error in callback (ignoring): failure: ERROR: relation "no_such_table" does not exist
Even if you wrap an C<eval> or a L<Try::Tiny> C<try {} catch {}> around the code the same thing happens. The try/catch is in effect while installing the callback, but not when the callback is called.
As a consequence of all this, asynchronous web frameworks usually cannot indicate errors with exceptions. Instead, they require you to respond to the client from inside the callback:
$dbh->exec("SELECT * FROM no_such_table", sub {
my ($dbh, $rows, $rv) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cikl/Client.pm view on Meta::CPAN
use strict;
use warnings;
use Mouse;
use namespace::autoclean;
use Try::Tiny;
use Config::Simple;
use Cikl::Client::Transport;
has 'transport' => (
is => 'ro',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Circle/Block.pm view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Exporter 'import';
use Carp;
use Try::Tiny;
use URL::Encode;
use Circle::Common qw(load_config build_url_template http_json_post http_json_get);
our $VERSION = '0.05';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Circle/Common.pm view on Meta::CPAN
use Exporter 'import';
use URL::Encode qw(url_encode_utf8);
use LWP::UserAgent;
use HTTP::Request;
use Slurp;
use Try::Tiny;
use YAML;
use JSON;
use Carp;
use File::Share ':all';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Circle/Node.pm view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Exporter 'import';
use Carp;
use Try::Tiny;
use URL::Encode;
use Circle::Common qw(load_config build_url_template http_json_post http_json_get);
our $VERSION = '0.05';
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-wallet.t view on Meta::CPAN
#!perl
use 5.006;
use strict;
use warnings;
use Test::More;
use Try::Tiny;
use JSON;
use Carp;
use Circle::Wallet;
# 1. create wallet using anonymous user.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/Load.pm view on Meta::CPAN
use base 'Exporter';
use Data::OptList 0.110 ();
use Module::Implementation 0.04;
use Module::Runtime 0.012 ();
use Try::Tiny;
{
my $loader = Module::Implementation::build_loader_sub(
implementations => [ 'XS', 'PP' ],
symbols => ['is_class_loaded'],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/Refresh.pm view on Meta::CPAN
# ABSTRACT: refresh your classes during runtime
use Carp 'carp';
use Class::Unload;
use Class::Load;
use Try::Tiny;
our %CACHE;
sub import {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/Usul/Crypt/Util.pm view on Meta::CPAN
use Class::Usul::Constants qw( FALSE NUL TRUE );
use Class::Usul::Crypt qw( decrypt default_cipher encrypt );
use Class::Usul::Functions qw( merge_attributes throw );
use Exporter 5.57 qw( import );
use File::DataClass::IO;
use Try::Tiny;
our @EXPORT_OK = qw( decrypt_from_config encrypt_for_config
get_cipher is_encrypted );
my $_args_cache = {};
lib/Class/Usul/Crypt/Util.pm view on Meta::CPAN
=over 3
=item L<Class::Usul>
=item L<Try::Tiny>
=item L<Exporter>
=back
view all matches for this distribution
view release on metacpan or search on metacpan
examples/09-error-handling.pl view on Meta::CPAN
use lib 'lib';
use Claude::Agent qw(query);
use Claude::Agent::Options;
use Claude::Agent::Error;
use Try::Tiny;
# Example 1: Handle CLI not found
say "Example 1: Handling CLI errors";
say "-" x 50;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Clean/Eval.pm view on Meta::CPAN
clean_eval { $cref->() }; # wrap in a literal block
&Clean::Eval::clean_eval($cref); # bypass the prototype
=head1 SEE ALSO
L<Try::Tiny>, L<Syntax::Keyword::Try>, L<Feature::Compat::Try>.
=head1 SOURCE
The source code repository for Clean-Eval can be found at
F<https://github.com/exodist/Clean-Eval/>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ClickHouse.pm view on Meta::CPAN
use URI;
use URI::Escape;
use URI::QueryParam;
use Carp;
use Scalar::Util qw/looks_like_number/;
use Try::Tiny;
our $AUTOLOAD;
sub new {
my ($class, %opts) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
"Test::LWP::UserAgent" : "0",
"Test::Moose" : "0",
"Test::More" : "0",
"Test::RequiresInternet" : "0",
"Test::TypeTiny" : "0",
"Try::Tiny" : "0",
"blib" : "1.01"
}
}
},
"provides" : {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/CutNPaste.pm view on Meta::CPAN
use 5.006;
use autodie;
use Benchmark qw(timediff timestr);
use Try::Tiny;
use Capture::Tiny qw(capture);
use Carp;
use File::Find::Rule;
use File::HomeDir;
use File::Slurp;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/Style/Kit.pm view on Meta::CPAN
package My::Kit::Part;
use strict;
use warnings;
sub feature_trytiny_default { 1 }
sub feature_trytiny_export_list { 'Try::Tiny' }
1;
To build the kit:
lib/Code/Style/Kit.pm view on Meta::CPAN
To use the kit:
package My::App;
use My::Kit;
# you now have Try::Tiny imported, plus whatever OtherPart did
=head1 DESCRIPTION
This package simplifies writing "code style kits". A kit (also known
as a "policy") is a module that encapsulates the common pragmas and
lib/Code/Style/Kit.pm view on Meta::CPAN
C<^\w+$>. Some features may be exported by default.
A simple example of a feature, from the synopsis:
sub feature_trytiny_default { 1 }
sub feature_trytiny_export_list { 'Try::Tiny' }
or, equivalently:
sub feature_trytiny_default { 1 }
sub feature_trytiny_export {
my ($self, $caller) = @_;
require Try::Tiny;
Try::Tiny->import::into($caller);
}
The C<feature_*_default> method says that this feature should always
be exported (unless the user explicitly asks us not to). The
C<feature_*_export_list> is a shortcut for the simple case of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/TidyAll/Plugin/YAMLFrontMatter.pm view on Meta::CPAN
use Moo;
use Encode qw( decode encode FB_CROAK );
use Path::Tiny qw( path );
use Try::Tiny qw( catch try );
use YAML::PP 0.006 ();
extends 'Code::TidyAll::Plugin';
# This regular expression is based on the regex
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/TidyAll/Plugin/YAPF.pm view on Meta::CPAN
use warnings;
package Code::TidyAll::Plugin::YAPF;
use IPC::Run3 qw(run3);
use Moo;
use Try::Tiny;
extends 'Code::TidyAll::Plugin';
our $VERSION = '0.18';
sub _build_cmd { 'yapf' }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/TidyAll.pm view on Meta::CPAN
use Specio::Library::Builtins;
use Specio::Library::Numeric;
use Specio::Library::Path::Tiny 0.04;
use Specio::Library::String;
use Time::Duration::Parse qw(parse_duration);
use Try::Tiny;
use Moo 2.000000;
our $VERSION = '0.85';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Collectd/Plugins/Riemann/Query.pm view on Meta::CPAN
use warnings;
use Collectd qw( :all );
use Collectd::Plugins::Common qw(recurse_config);
use Riemann::Client;
use Try::Tiny;
#use DDP {
# deparse => 1,
# class => {
# expand => 'all'
# }
view all matches for this distribution
view release on metacpan or search on metacpan
t/app/Plack/HTTPParser.t view on Meta::CPAN
left => leaf '@EXPORT',
right => reg_prefix { 'qw',
expr => leaf ' parse_http_request ',
},
},
module { 'Try::Tiny',
},
block { '',
body => if_stmt { 'if',
expr => branch { '&&',
left => single_term_operator { '!',
t/app/Plack/HTTPParser.t view on Meta::CPAN
use strict;
use parent qw(Exporter);
our @EXPORT = qw( parse_http_request );
use Try::Tiny;
{
if (!$ENV{PLACK_HTTP_PARSER_PP} && try { require HTTP::Parser::XS; 1 }) {
*parse_http_request = \&HTTP::Parser::XS::parse_http_request;
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ConditionSystem.pm view on Meta::CPAN
use strict;
use warnings FATAL => 'all';
use Scope::Upper qw( unwind :words );
use Scalar::Util 'blessed';
use Try::Tiny;
use Sub::Exporter -setup => {
exports => [qw( restart with_handlers bind_continue handle restart_case )],
groups => {
default => [qw( restart with_handlers bind_continue handle restart_case )]
lib/ConditionSystem.pm view on Meta::CPAN
my $err = shift;
for my $handles (keys %handlers) {
if($err->isa($handles)) {
my $handler = $handlers{$handles};
$handler = ${$handler}
if blessed($handler) && $handler->isa('Try::Tiny::Catch');
unwind $handler->($err) => UP UP HERE;
return "Well, it should never get here...";
}
}
};
view all matches for this distribution
view release on metacpan or search on metacpan
"build_requires" => {
"File::Find" => 0,
"File::Temp" => 0,
"Module::Build" => "0.3601",
"Test::More" => 0,
"Try::Tiny" => 0
},
"configure_requires" => {
"ExtUtils::MakeMaker" => "6.30",
"Module::Build" => "0.3601"
},
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Fatal.pm view on Meta::CPAN
}
# ABSTRACT: incredibly simple helpers for testing code with exceptions
use Carp ();
use Try::Tiny 0.07;
use Exporter 5.57 'import';
our @EXPORT = qw(exception);
our @EXPORT_OK = qw(exception success dies_ok lives_ok);
view all matches for this distribution
view release on metacpan or search on metacpan
"Role::Identifiable::HasIdent" : "0",
"StackTrace::Auto" : "0",
"Test::More" : "0.96",
"Throwable" : "0",
"Tie::IxHash" : "0",
"Try::Tiny" : "0",
"overload" : "0",
"perl" : "5.012",
"strict" : "0",
"warnings" : "0"
}
view all matches for this distribution