Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't let exceptions tank the application

  • Loading branch information...
commit 2fd62a2dcc4ec9ca8a24a598bef95b52f2e0fa7a 1 parent 900ff2d
Gatlin C Johnson authored
Showing with 19 additions and 6 deletions.
  1. +19 −6 lib/Deployrable.pm
View
25 lib/Deployrable.pm
@@ -187,7 +187,10 @@ sub startup {
my $bid = $self->param('bid');
my $iid = $self->param('iid');
- $compute->_action($iid,'os-stop' => undef);
+ eval {
+ $compute->_action($iid,'os-stop' => undef)
+ } or do {};
+
$self->redirect_to("/project/$pid/$bid");
});
@@ -197,7 +200,9 @@ sub startup {
my $bid = $self->param('bid');
my $iid = $self->param('iid');
- $compute->_action($iid,'os-start' => undef);
+ eval {
+ $compute->_action($iid,'os-start' => undef);
+ } or do {};
$self->redirect_to("/project/$pid/$bid");
});
@@ -207,7 +212,9 @@ sub startup {
my $bid = $self->param('bid');
my $iid = $self->param('iid');
- $compute->_action($iid,'pause' => undef);
+ eval {
+ $compute->_action($iid,'pause' => undef);
+ } or do {};
$self->redirect_to("/project/$pid/$bid");
});
@@ -217,7 +224,9 @@ sub startup {
my $bid = $self->param('bid');
my $iid = $self->param('iid');
- $compute->_action($iid,'unpause' => undef);
+ eval {
+ $compute->_action($iid,'unpause' => undef);
+ } or do {};
$self->redirect_to("/project/$pid/$bid");
});
@@ -227,7 +236,9 @@ sub startup {
my $bid = $self->param('bid');
my $iid = $self->param('iid');
- $compute->_action($iid,'reboot' => {'type' => 'SOFT'});
+ eval {
+ $compute->_action($iid,'reboot' => {'type' => 'SOFT'});
+ } or do {};
$self->redirect_to("/project/$pid/$bid");
});
@@ -242,7 +253,9 @@ sub startup {
where id = $pid;
");
my $ret = $sth->execute;
- $compute->delete_server($iid);
+ eval {
+ $compute->delete_server($iid);
+ } or do {};
$self->redirect_to("/project/$pid/$bid");
});
Please sign in to comment.
Something went wrong with that request. Please try again.