diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-03-12 13:16:10 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-03-12 13:16:10 +0100 |
commit | 2aed7a3550d51223ca6b9301e6562c61fc1a66cb (patch) | |
tree | 5c91ad7282faf48064c060c1568ccbd3d9622b75 | |
parent | 03a843eaf592133983e093e0bbe03aff02331132 (diff) |
error.uri set
-rw-r--r-- | lib/opentox.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 05a8a08..e603336 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -18,9 +18,8 @@ module OpenTox end error do - # TODO: set actor, calling OT::Error with uri parameter does not work error = request.env['sinatra.error'] - #error.report.actor = "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}" + error.uri = "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}" case request.env['HTTP_ACCEPT'] when 'application/rdf+xml' content_type 'application/rdf+xml' @@ -47,9 +46,8 @@ module OpenTox body = error.message body += "\n#{error.backtrace}" end - code = error.http_code if error.respond_to? :http_code - code ||= 500 - halt code, error.report.to_turtle + error.respond_to?(:http_code) ? code = error.http_code : code = 500 + halt code, body end end end |