Open
Description
try {
// ....
} catch (\Throwable $e) {
// ....
\MyProject\Namespace\MyCustomException::raise($id, $e /*will be injected as previous*/)
}
// src/Exception/MyCustomException.php
namespace MyProject\Namespace;
class MyCustomException extends \Exception
{
public static function raise(string $id, \Throwable $previous)
{
throw new self("something went wrong with #{$id}", 0, $previous);
}
}
This will not be detected and I get this message:
caught "Throwable" must be rethrown. Either catch amore specific exception or add a "throw" clause in the "catch" block to propagate the exception. More info:
Does this rule require the rethrow be explicit or is it just a small bug?
Metadata
Metadata
Assignees
Labels
No labels