MT#3931 API: Use TryCatch instead of Try::Tiny

gjungwirth/fix_tests
Andreas Granig 12 years ago
parent e8fa8b2f9c
commit efafd55c87

@ -3,7 +3,7 @@ use Moose::Role;
use Sipwise::Base;
use boolean qw(true);
use Try::Tiny;
use TryCatch;
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Status qw(:constants);
@ -30,8 +30,8 @@ sub hal_from_contract {
profile => $billing_mapping->billing_profile,
contract => $contract,
);
} catch {
$self->log->error("Failed to create current contract balance for contract id '".$contract->id."': $_");
} catch($e) {
$self->log->error("Failed to create current contract balance for contract id '".$contract->id."': $e");
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Internal Server Error.");
return;
}

@ -3,7 +3,7 @@ use Moose::Role;
use Sipwise::Base;
use boolean qw(true);
use Try::Tiny;
use TryCatch;
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Status qw(:constants);
@ -30,8 +30,8 @@ sub hal_from_customer {
profile => $billing_mapping->billing_profile,
contract => $customer,
);
} catch {
$self->log->error("Failed to create current contract balance for customer contract id '".$customer->id."': $_");
} catch($e) {
$self->log->error("Failed to create current contract balance for customer contract id '".$customer->id."': $e");
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Internal Server Error.");
return;
};

Loading…
Cancel
Save