From e471a1f93ee23f0f729d64068504cb892481b56f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 16 Jun 2022 05:53:18 +0200 Subject: 4chan: show error from server when posting fails (when error is not one of the predefined ones) --- plugins/ImageBoard.hpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/ImageBoard.hpp b/plugins/ImageBoard.hpp index 157ac1c..b324ea9 100644 --- a/plugins/ImageBoard.hpp +++ b/plugins/ImageBoard.hpp @@ -3,16 +3,23 @@ #include "Page.hpp" namespace QuickMedia { - enum class PostResult { - OK, - TRY_AGAIN, - INVALID_CAPTCHA, - BANNED, - //FILE_TOO_LARGE, - NO_SUCH_FILE, - FILE_TYPE_NOT_ALLOWED, - UPLOAD_FAILED, - ERR + struct PostResult { + enum class Type { + OK, + TRY_AGAIN, + INVALID_CAPTCHA, + BANNED, + //FILE_TOO_LARGE, + NO_SUCH_FILE, + FILE_TYPE_NOT_ALLOWED, + UPLOAD_FAILED, + ERR + }; + + PostResult(Type type) : type(type) {} + + Type type; + std::string err_msg; }; // All fields are optional -- cgit v1.2.3