summaryrefslogtreecommitdiff
path: root/lib/api/labels.rb
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2015-01-07 10:46:00 +0100
committerMarin Jankovski <maxlazio@gmail.com>2015-01-07 10:46:00 +0100
commitcd0aed3d54fc01d0c361a8cf282d2de48297f66a (patch)
tree9bd4d1a97827d95ad9e854ec5215dddfa1c953b9 /lib/api/labels.rb
parent0da5154b5a71216a9bbff861561636906ca8c167 (diff)
downloadgitlab-ce-cd0aed3d54fc01d0c361a8cf282d2de48297f66a.tar.gz
Add a message when unable to save an object through api.
Diffstat (limited to 'lib/api/labels.rb')
-rw-r--r--lib/api/labels.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/labels.rb b/lib/api/labels.rb
index 78ca58ad0d1..e8ded662253 100644
--- a/lib/api/labels.rb
+++ b/lib/api/labels.rb
@@ -37,7 +37,7 @@ module API
if label.valid?
present label, with: Entities::Label
else
- render_validation_error!(label)
+ render_api_error!("Unable to create label #{label.errors.messages}", 400)
end
end
@@ -90,7 +90,7 @@ module API
if label.update(attrs)
present label, with: Entities::Label
else
- render_validation_error!(label)
+ render_api_error!("Unable to create label #{label.errors.messages}", 400)
end
end
end