summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-16 08:54:39 +0100
committerNick Thomas <nick@gitlab.com>2018-12-07 12:31:36 +0000
commit1e3881b0003e604172dbdb859fa4fea2ed63ef2c (patch)
treef21fc0b7a20938b193bc1a610d95db5fbfca8497
parent4d801a70fb7a2474e988334b059df3bcc72c2ae6 (diff)
downloadgitlab-ce-1e3881b0003e604172dbdb859fa4fea2ed63ef2c.tar.gz
Updated ajax error message with returned errors
-rw-r--r--app/assets/javascripts/notes/components/comment_form.vue16
1 files changed, 10 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue
index 841fcec96e8..ce56beb1e6b 100644
--- a/app/assets/javascripts/notes/components/comment_form.vue
+++ b/app/assets/javascripts/notes/components/comment_form.vue
@@ -247,15 +247,19 @@ Please check your network connection and try again.`;
} else {
this.reopenIssue()
.then(() => this.enableButton())
- .catch(() => {
+ .catch(({ data }) => {
this.enableButton();
this.toggleStateButtonLoading(false);
- Flash(
- sprintf(
- __('Something went wrong while reopening the %{issuable}. Please try again later'),
- { issuable: this.noteableDisplayName },
- ),
+ let errorMessage = sprintf(
+ __('Something went wrong while reopening the %{issuable}. Please try again later'),
+ { issuable: this.noteableDisplayName },
);
+
+ if (data) {
+ errorMessage = Object.values(data).join('\n');
+ }
+
+ Flash(errorMessage);
});
}
},