From 0bab0f6700f5c265b81bdcd26c471b3d49b371a4 Mon Sep 17 00:00:00 2001 From: Dylan G <1565516+Helloman892@users.noreply.github.com> Date: Thu, 11 Mar 2021 12:34:03 +0000 Subject: [PATCH] Patched httpc error message to actually be readable on console; also provides Result code --- source/draw.c | 2 +- source/remote.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/draw.c b/source/draw.c index 20991dd..728ea56 100644 --- a/source/draw.c +++ b/source/draw.c @@ -301,7 +301,7 @@ void throw_error(char* error, ErrorLevel level) draw_base_interface(); draw_text_center(GFX_TOP, 100, 0.5f, 0.6f, 0.6f, colors[text_color], error); - draw_c2d_text_center(GFX_TOP, 150, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[bottom_text]); + draw_c2d_text_center(GFX_TOP, 170, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[bottom_text]); end_frame(); if(kDown & KEY_A) break; diff --git a/source/remote.c b/source/remote.c index 09dc3e4..be3aa5d 100644 --- a/source/remote.c +++ b/source/remote.c @@ -953,7 +953,7 @@ redirect: // goto here if we need to redirect return ret; } -#define ERROR_BUFFER_SIZE 0x70 +#define ERROR_BUFFER_SIZE 0x80 char err_buf[ERROR_BUFFER_SIZE]; ParseResult parse = parse_header(&_header, &context, acceptable_mime_types); switch (parse) @@ -991,8 +991,9 @@ redirect: // goto here if we need to redirect snprintf(err_buf, ERROR_BUFFER_SIZE, ZIP_NOT_AVAILABLE); goto error; case HTTPC_ERROR: - DEBUG("httpc error\n"); - throw_error("Error in HTTPC sysmodule.\nIf you are seeing this, please\ncontact an Anemone developer on\nthe ThemePlaza Discord.", ERROR_LEVEL_ERROR); + DEBUG("httpc error %lx\n", _header.result_code); + snprintf(err_buf, ERROR_BUFFER_SIZE, "Error in HTTPC sysmodule - 0x%lx.\nIf you are seeing this, please contact an\nAnemone developer on the ThemePlaza Discord.", _header.result_code); + throw_error(err_buf, ERROR_LEVEL_ERROR); quit = true; httpcCloseContext(&context); return _header.result_code;