Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-02-23 02:01:49 +0300
committerVinnie Okada <vokada@mrvinn.com>2015-02-23 02:01:49 +0300
commit5f232b5687b447e7eac40f58c56628da22580de6 (patch)
tree5122af76e3efcc2425e10552a95ccf16df4d6fa1 /lib/api/files.rb
parentebe0d34128c31bb88f6eb5aca96fae012c7fcf8b (diff)
Improve error messages when file editing fails
Give more specific errors in API responses and web UI flash messages when a file update fails.
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index e6e71bac367..3176ef0e256 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -117,7 +117,8 @@ module API
branch_name: branch_name
}
else
- render_api_error!(result[:message], 400)
+ http_status = result[:http_status] || 400
+ render_api_error!(result[:message], http_status)
end
end