mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Added BadPacketException::wrap()
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user