Skip to content

Commit

Permalink
Adapter: logException() requires Throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
janpecha committed Nov 2, 2023
1 parent e2f6b50 commit b6305c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,5 @@ function fetchNext(
): ?Message;


/**
* @param \Exception|\Throwable $e
* @return void
*/
function logException($e);
function logException(\Throwable $e): void;
}
4 changes: 0 additions & 4 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ private function processMessage(Message $message, callable $handler): void
$this->markAsDeferred($message, (int) $result->getDeferInterval());
}

} catch (\Exception $e) {
$this->markAsFailed($message);
$this->adapter->logException($e);

} catch (\Throwable $e) {
$this->markAsFailed($message);
$this->adapter->logException($e);
Expand Down
2 changes: 1 addition & 1 deletion src/MemoryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function fetchNext(
}


public function logException($e)
public function logException(\Throwable $e): void
{
($this->exceptionHandler)($e);
}
Expand Down

0 comments on commit b6305c0

Please sign in to comment.