diff --git a/src/entity/Skin.php b/src/entity/Skin.php index f10d72fc3b..0cdfa11604 100644 --- a/src/entity/Skin.php +++ b/src/entity/Skin.php @@ -28,7 +28,6 @@ use function implode; use function in_array; use function json_encode; -use function json_last_error_msg; use function strlen; use const JSON_THROW_ON_ERROR; @@ -68,9 +67,10 @@ public function __construct(string $skinId, string $skinData, string $capeData = } if($geometryData !== ""){ - $decodedGeometry = (new CommentedJsonDecoder())->decode($geometryData); - if($decodedGeometry === false){ - throw new InvalidSkinException("Invalid geometry data (" . json_last_error_msg() . ")"); + try{ + $decodedGeometry = (new CommentedJsonDecoder())->decode($geometryData); + }catch(\RuntimeException $e){ + throw new InvalidSkinException("Invalid geometry data: " . $e->getMessage(), 0, $e); } /*