From 2aed7a3550d51223ca6b9301e6562c61fc1a66cb Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 12 Mar 2012 13:16:10 +0100 Subject: error.uri set --- lib/opentox.rb | 8 +++----- 1 file 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 -- cgit v1.2.3