Skip to content

Commit

Permalink
Show criteria upon search timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-mailosaur committed Jun 12, 2024
1 parent ed95b3c commit 8a98e84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Operations/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function get($server, SearchCriteria $searchCriteria, $timeout = 10000, \
$datetime->sub(new \DateInterval('PT1H'));
}

$result = $this->search($server, $searchCriteria, 0, 1, $timeout, $receivedAfter, $dir);
$result = $this->search($server, $searchCriteria, 0, 1, $timeout, $receivedAfter, true, $dir);
return $this->getById($result->items[0]->id);
}

Expand Down Expand Up @@ -208,7 +208,7 @@ public function search($server, SearchCriteria $searchCriteria, $page = 0, $item
return $result;
}

throw new MailosaurException("No matching messages found in time. By default, only messages received in the last hour are checked (use receivedAfter to override this).", "search_timeout");
throw new MailosaurException("No matching messages found in time. By default, only messages received in the last hour are checked (use receivedAfter to override this). The search criteria used for this query was [".$payload."] which timed out after ".$timeout."ms", "search_timeout");
}

sleep($delay / 1000);
Expand Down

0 comments on commit 8a98e84

Please sign in to comment.