From b6134b992fde8784c3556fbca32925e721700d32 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 20 Feb 2012 16:16:56 +0000 Subject: task catches and reports errors (some dataset tests still fail) --- lib/error.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/error.rb') diff --git a/lib/error.rb b/lib/error.rb index 64cc4eb..6987f35 100644 --- a/lib/error.rb +++ b/lib/error.rb @@ -17,16 +17,22 @@ module OpenTox class NotFoundError < RuntimeError def http_code; 404; end end + + class LockedError < RuntimeError + def http_code; 423; end + end class ServiceUnavailableError < RuntimeError def http_code; 503; end end + # TODO: add to RestClientCalls class RestCallError < RuntimeError attr_accessor :rest_params def http_code; 502; end end + # TODO: add to Exception class?? class ErrorReport # TODO replace params with URIs (errorCause -> OT.errorCause) @@ -78,11 +84,14 @@ module OpenTox c end + # TODO: use rdf.rb def to_rdfxml s = Serializer::Owl.new s.add_resource(CONFIG[:services]["opentox-task"]+"/tmpId/ErrorReport/tmpId", OT.errorReport, rdf_content) s.to_rdfxml end +=begin +=end end end -- cgit v1.2.3