From d449701b84394f7aa3c4857c801fff3aaa1ef045 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 22 Jun 2026 15:48:30 +0300 Subject: [PATCH] post status form error handling --- src/components/post_status_form/post_status_form.js | 5 ----- src/services/errors/errors.js | 5 +++-- src/services/status_poster/status_poster.service.js | 5 ----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 7eb129430..c564355f3 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -635,11 +635,6 @@ const PostStatusForm = { // Don't apply preview if not loading, because it means // user has closed the preview manually. if (!this.previewLoading) return - if (!data.error) { - this.preview = data - } else { - this.preview = { error: data.error } - } }) .catch((error) => { this.preview = { error } diff --git a/src/services/errors/errors.js b/src/services/errors/errors.js index 41829eb19..12d32c12b 100644 --- a/src/services/errors/errors.js +++ b/src/services/errors/errors.js @@ -13,8 +13,9 @@ function humanizeErrors(errors) { export function StatusCodeError(statusCode, body, options, response) { this.name = 'StatusCodeError' this.statusCode = statusCode - this.message = - statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(body) : body) + this.details = JSON && JSON.stringify ? JSON.stringify(body) : body + this.errorData = body.error + this.message = statusCode + ' - ' + body.error.error || body.error this.error = body // legacy attribute this.options = options this.response = response diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js index 7fa67e338..2d6ec9313 100644 --- a/src/services/status_poster/status_poster.service.js +++ b/src/services/status_poster/status_poster.service.js @@ -49,11 +49,6 @@ const postStatus = ({ return data }) - .catch((err) => { - return { - error: err.message, - } - }) } const editStatus = ({