diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-02-22 16:01:49 -0700 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-02-22 16:01:49 -0700 |
commit | 5f232b5687b447e7eac40f58c56628da22580de6 (patch) | |
tree | 5122af76e3efcc2425e10552a95ccf16df4d6fa1 /lib/api/files.rb | |
parent | ebe0d34128c31bb88f6eb5aca96fae012c7fcf8b (diff) | |
download | gitlab-ce-5f232b5687b447e7eac40f58c56628da22580de6.tar.gz |
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.rb | 3 |
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 |