confess() rather than die() in these locations.

This commit is contained in:
Bradley M. Kuhn 2024-11-18 18:27:06 -08:00
parent 3e4bd08b23
commit 777c77baf9

View file

@ -1137,12 +1137,12 @@ sub getRequest($$;$) {
my $requestTypeClause = "";
if (defined $requestTypeId) {
$requestType = $self->_lookupRequestTypeById($requestTypeId);
die "getRequest: invalid requestTypeId, \"$requestTypeId\"" unless defined $requestType;
confess "getRequest: invalid requestTypeId, \"$requestTypeId\"" unless defined $requestType;
$requestTypeClause = " AND rt.id = " . $self->dbh->quote($requestTypeId, 'SQL_INTEGER');
} elsif (defined $requestType) {
$requestTypeClause = " AND rt.type = " . $self->dbh->quote($requestType);
} else {
die "getRequest: undefined requestType" unless defined $requestType;
confess "getRequest: undefined requestType" unless defined $requestType;
}
my $req = $self->dbh()->selectall_hashref("SELECT r.id, r.request_type_id, r.request_configuration_id, r.date_requested, r.notes, rt.type " .
"FROM request r, request_type rt WHERE r.request_type_id = rt.id AND " .