aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-06-16 05:53:18 +0200
committerdec05eba <dec05eba@protonmail.com>2022-06-16 05:53:18 +0200
commite471a1f93ee23f0f729d64068504cb892481b56f (patch)
treea75b0a9d5ff891b603096c75e07a2346801b70e2 /plugins
parent3586e3b510ef6828ab44dad1467f18ef4f2d7e2b (diff)
4chan: show error from server when posting fails (when error is not one of the predefined ones)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ImageBoard.hpp27
1 files changed, 17 insertions, 10 deletions
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