From ef0d33aac4116205c1bfb5785ebfbd4dec1abb4e Mon Sep 17 00:00:00 2001 From: 1e99 Date: Mon, 16 Dec 2024 18:10:03 +0100 Subject: [PATCH] improve fabric error handling --- mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java b/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java index b95b465..98eb7c5 100644 --- a/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java +++ b/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java @@ -99,7 +99,8 @@ public class ImageUploads { HttpResponse.BodyHandlers.ofString() ); if (res.statusCode() != 201) { - throw new RuntimeException(String.format("Failed to upload, expected status 201, got %d", res.statusCode())); + String body = res.body(); + throw new RuntimeException(String.format("Failed to upload, expected status 201, got %d, body: %s", res.statusCode(), body)); } String id = res.body();