FIX: Return 'failed' attribute when catching an ajax error and the attribute is present

FIX: Return ‘failed’ attribute when catching an ajax error and the attribute is present

diff --git a/app/assets/javascripts/discourse/lib/ajax-error.js.es6 b/app/assets/javascripts/discourse/lib/ajax-error.js.es6
index 8e7366d..5cc5464 100644
--- a/app/assets/javascripts/discourse/lib/ajax-error.js.es6
+++ b/app/assets/javascripts/discourse/lib/ajax-error.js.es6
@@ -35,7 +35,7 @@ export function extractError(error, defaultMessage) {
     } else if (parsedJSON.error) {
       parsedError = parsedJSON.error;
     } else if (parsedJSON.failed) {
-      parsedError = parsedJSON.message;
+      parsedError = parsedJSON.failed;
     }
   }

GitHub sha: 34b77257

1 Like