From 9cfd6ad6a4651280a12099d1a92432f07fc5aae0 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Tue, 5 Oct 2021 03:44:18 +0200 Subject: BaseJob: refresh error handling - BaseJob::prepareError() slightly updated to get the current status instead of checking the returned value outside in gotReply() - BaseJob::gotReply() no more reports on 429 Too Many Requests twice (the first time with dubious "Too Many Requests: Unknown error") --- lib/jobs/basejob.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/jobs/basejob.h') diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h index e0910a26..119d7cce 100644 --- a/lib/jobs/basejob.h +++ b/lib/jobs/basejob.h @@ -399,10 +399,12 @@ protected: * was not good (usually because of an unsuccessful HTTP code). * The base implementation assumes Matrix JSON error object in the body; * overrides are strongly recommended to call it for all stock Matrix - * responses as early as possible but in addition can process custom errors, + * responses as early as possible and only then process custom errors, * with JSON or non-JSON payload. + * + * \return updated (if necessary) job status */ - virtual Status prepareError(); + virtual Status prepareError(Status currentStatus); /*! \brief Get direct access to the JSON response object in the job * -- cgit v1.2.3