OneTicketPerRequestor: Catch and report errors in the ticket search.
This commit is contained in:
parent
daeabc1aa6
commit
d7a24b0f97
1 changed files with 20 additions and 15 deletions
|
@ -77,6 +77,7 @@ sub BeforeDecrypt {
|
|||
return;
|
||||
}
|
||||
|
||||
my $dest_ticket = eval {
|
||||
my $ticket_search = RT::Tickets->new($RT::SystemUser);
|
||||
$ticket_search->LimitQueue(
|
||||
OPERATOR => "=",
|
||||
|
@ -90,9 +91,13 @@ sub BeforeDecrypt {
|
|||
foreach my $sort_args (@$sort_orders) {
|
||||
$ticket_search->OrderBy(@$sort_args);
|
||||
}
|
||||
|
||||
my $dest_ticket = $ticket_search->First;
|
||||
if (!defined($dest_ticket)) {
|
||||
$ticket_search->First;
|
||||
};
|
||||
if ($@) {
|
||||
$RT::Logger->debug("OTPR stopping: Ticket search died: $@");
|
||||
return;
|
||||
}
|
||||
elsif (!defined($dest_ticket)) {
|
||||
$RT::Logger->debug(sprintf("OTPR stopping: No ticket found from <%s> in queue %s",
|
||||
$from_address, $queue_name));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue