summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-25 18:12:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-25 18:12:01 +0100
commita3688f64d5121e6ee14c55a21da02398cb28b995 (patch)
tree212fb60317c98ed49cb669795f0b2db66a17f8ba
parente2b78170a5b4fba9a6ac9430140320a515739634 (diff)
Log SQL errors
-rwxr-xr-xlib/Travelynx.pm24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 039ab6e..7c89b04 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -582,7 +582,11 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
return ( $train, undef );
}
else {
- return ( undef, 'INSERT failed' );
+ my $uid = $self->current_user->{id};
+ my $err = $self->app->action_query->errstr;
+ $self->app->log->error(
+ "Checkin($uid, $action_id): INSERT failed: $err");
+ return ( undef, 'INSERT failed: ' . $err );
}
}
}
@@ -617,7 +621,10 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
return;
}
else {
- return 'INSERT failed';
+ my $uid = $self->current_user->{id};
+ my $err = $self->app->action_query->errstr;
+ $self->app->log->error("Undo($uid): INSERT failed: $err");
+ return 'INSERT failed: ' . $err;
}
}
);
@@ -658,7 +665,12 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
return;
}
else {
- return 'INSERT failed';
+ my $uid = $self->current_user->{id};
+ my $err = $self->app->action_query->errstr;
+ $self->app->log->error(
+"Force checkout($uid, $action_id): INSERT failed: $err"
+ );
+ return 'INSERT failed: ' . $err;
}
}
else {
@@ -695,7 +707,11 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
return;
}
else {
- return 'INSERT failed';
+ my $uid = $self->current_user->{id};
+ my $err = $self->app->action_query->errstr;
+ $self->app->log->error(
+ "Checkout($uid, $action_id): INSERT failed: $err");
+ return 'INSERT failed: ' . $err;
}
}
}