projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1495-crunch-documentation'
[arvados.git]
/
services
/
api
/
app
/
controllers
/
application_controller.rb
diff --git
a/services/api/app/controllers/application_controller.rb
b/services/api/app/controllers/application_controller.rb
index 2f07c394609a7664abec7a88630fd48c6b308c83..434b09572b40b64af026e27a43962b422aeea7c6 100644
(file)
--- a/
services/api/app/controllers/application_controller.rb
+++ b/
services/api/app/controllers/application_controller.rb
@@
-69,7
+69,7
@@
class ApplicationController < ActionController::Base
:with => :render_not_found
rescue_from ActionController::UnknownController,
:with => :render_not_found
:with => :render_not_found
rescue_from ActionController::UnknownController,
:with => :render_not_found
- rescue_from A
ctionController::UnknownAction
,
+ rescue_from A
bstractController::ActionNotFound
,
:with => :render_not_found
rescue_from ArvadosModel::PermissionDeniedError,
:with => :render_error
:with => :render_not_found
rescue_from ArvadosModel::PermissionDeniedError,
:with => :render_error
@@
-83,7
+83,8
@@
class ApplicationController < ActionController::Base
else
errors = [e.inspect]
end
else
errors = [e.inspect]
end
- render json: { errors: errors }, status: 422
+ status = e.respond_to?(:http_status) ? e.http_status : 422
+ render json: { errors: errors }, status: status
end
def render_not_found(e=ActionController::RoutingError.new("Path not found"))
end
def render_not_found(e=ActionController::RoutingError.new("Path not found"))
@@
-354,4
+355,9
@@
class ApplicationController < ActionController::Base
order: { type: 'string', required: false }
}
end
order: { type: 'string', required: false }
}
end
+
+ def client_accepts_plain_text_stream
+ (request.headers['Accept'].split(' ') &
+ ['text/plain', '*/*']).count > 0
+ end
end
end