mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Added BadPacketException::wrap()
This commit is contained in:
parent
a95426c373
commit
2d46ae4476
@ -25,4 +25,7 @@ namespace pocketmine\network;
|
||||
|
||||
class BadPacketException extends \RuntimeException{
|
||||
|
||||
public static function wrap(\Throwable $previous, ?string $prefix = null) : self{
|
||||
return new self(($prefix !== null ? $prefix . ": " : "") . $previous->getMessage(), 0, $previous);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user