summaryrefslogtreecommitdiff
path: root/lib/error.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-02-20 16:16:56 +0000
committerChristoph Helma <helma@in-silico.ch>2012-02-20 16:16:56 +0000
commitb6134b992fde8784c3556fbca32925e721700d32 (patch)
treefcbac8c01883209aa451282f37592ce4f5794038 /lib/error.rb
parent64135ae320998a836725786f95a4efd3b63f585c (diff)
task catches and reports errors (some dataset tests still fail)
Diffstat (limited to 'lib/error.rb')
-rw-r--r--lib/error.rb9
1 files changed, 9 insertions, 0 deletions
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