FIX: Show error message if message exists

FIX: Show error message if message exists

diff --git a/app/assets/javascripts/discourse/lib/ajax-error.js.es6 b/app/assets/javascripts/discourse/lib/ajax-error.js.es6
index 5cc5464..de96aa1 100644
--- a/app/assets/javascripts/discourse/lib/ajax-error.js.es6
+++ b/app/assets/javascripts/discourse/lib/ajax-error.js.es6
@@ -34,6 +34,8 @@ export function extractError(error, defaultMessage) {
       parsedError = parsedJSON.errors.join("<br>");
     } else if (parsedJSON.error) {
       parsedError = parsedJSON.error;
+    } else if (parsedJSON.message) {
+      parsedError = parsedJSON.message;
     } else if (parsedJSON.failed) {
       parsedError = parsedJSON.failed;
     }

GitHub sha: 34684af1

1 Like

I have a feeling we aren’t being consistent with our error messages.

Yeah, there are all kinds of different usages because we always do failed_json.merge(something). I guess that happens when there is no API to always generate a similar JSON for error messages.

1 Like