projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
094cb7f
)
fix error handling
author
Tom Clegg <tom@clinicalfuture.com>
Wed, 16 Jan 2013 22:43:37 +0000
(14:43 -0800)
committer
Tom Clegg <tom@clinicalfuture.com>
Wed, 16 Jan 2013 22:43:37 +0000
(14:43 -0800)
app/controllers/application_controller.rb
patch
|
blob
|
history
diff --git
a/app/controllers/application_controller.rb
b/app/controllers/application_controller.rb
index dcd47a76efd25151a695b6bac5f21175f698ff41..6ea18ce315e3acbc0fd02e274e8ae81ba11df9c4 100644
(file)
--- a/
app/controllers/application_controller.rb
+++ b/
app/controllers/application_controller.rb
@@
-29,7
+29,7
@@
class ApplicationController < ActionController::Base
def render_not_found(e=ActionController::RoutingError.new("Path not found"))
logger.error e.inspect
- render json: { errors: ["Path not found"] }, status: 40
1
+ render json: { errors: ["Path not found"] }, status: 40
4
end
def index
@@
-38,7
+38,11
@@
class ApplicationController < ActionController::Base
end
def show
- render json: @object.as_api_response(:superuser)
+ if @object
+ render json: @object.as_api_response(:superuser)
+ else
+ render_not_found("object not found")
+ end
end
def create