From 813fb533f97e77dd4385b4641df13d578236e8a1 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 11 Nov 2022 22:51:01 +1100 Subject: [PATCH] Use more verbose error messages for 404/403/401 texture pack download errors --- src/TexturePack.c | 12 +++++++++--- src/Window_SDL.c | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/TexturePack.c b/src/TexturePack.c index 3edb07e2f..4eb353c75 100644 --- a/src/TexturePack.c +++ b/src/TexturePack.c @@ -409,10 +409,16 @@ void TexturePack_CheckPending(void) { Mem_Free(item.data); } else if (item.result) { Logger_Warn(item.result, "trying to download texture pack", Http_DescribeError); + } else if (item.statusCode == 200 || item.statusCode == 304) { + /* Empty responses is okay for these status codes, so don't log an error */ + } else if (item.statusCode == 404) { + Chat_AddRaw("&c404 Not Found error when trying to download texture pack"); + Chat_AddRaw(" &cThe texture pack URL may be incorrect or no longer exist"); + } else if (item.statusCode == 401 || item.statusCode == 403) { + Chat_Add1("&c%i Not Authorised error when trying to download texture pack", &item.statusCode); + Chat_AddRaw(" &cThe texture pack URL may not be publicly shared"); } else { - int status = item.statusCode; - if (status == 200 || status == 304) return; - Chat_Add1("&c%i error when trying to download texture pack", &status); + Chat_Add1("&c%i error when trying to download texture pack", &item.statusCode); } } diff --git a/src/Window_SDL.c b/src/Window_SDL.c index 377fa59d3..5b08849bc 100644 --- a/src/Window_SDL.c +++ b/src/Window_SDL.c @@ -9,6 +9,8 @@ #include static SDL_Window* win_handle; +#error "Some features are missing from the SDL backend. If possible, it is recommended that you use a native windowing backend instead" + static void RefreshWindowBounds(void) { SDL_GetWindowSize(win_handle, &WindowInfo.Width, &WindowInfo.Height); }