Class: OpenTox::ErrorReport
- Inherits:
-
Object
- Object
- OpenTox::ErrorReport
- Defined in:
- lib/error.rb
Instance Attribute Summary collapse
-
#actor ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
-
#errorCause ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
-
#errorDetails ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
-
#errorType ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
-
#http_code ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
-
#message ⇒ Object
readonly
TODO replace params with URIs (errorCause -> OT.errorCause).
Class Method Summary collapse
-
.create(error, actor) ⇒ Object
creates a error report object, from an ruby-exception object.
- .from_rdf(rdf) ⇒ Object
Instance Method Summary collapse
- #rdf_content ⇒ Object
- #to_rdfxml ⇒ Object
-
#to_yaml_properties ⇒ Object
overwrite sorting to make easier readable.
Instance Attribute Details
#actor ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def actor @actor end |
#errorCause ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def errorCause @errorCause end |
#errorDetails ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def errorDetails @errorDetails end |
#errorType ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def errorType @errorType end |
#http_code ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def http_code @http_code end |
#message ⇒ Object (readonly)
TODO replace params with URIs (errorCause -> OT.errorCause)
34 35 36 |
# File 'lib/error.rb', line 34 def @message end |
Class Method Details
.create(error, actor) ⇒ Object
creates a error report object, from an ruby-exception object
51 52 53 54 55 |
# File 'lib/error.rb', line 51 def self.create( error, actor ) rest_params = error.rest_params if error.is_a?(OpenTox::RestCallError) and error.rest_params backtrace = error.backtrace.short_backtrace if CONFIG[:backtrace] ErrorReport.new( error.http_code, error.class.to_s, error., actor, error.errorCause, rest_params, backtrace ) end |
Instance Method Details
#rdf_content ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/error.rb', line 70 def rdf_content() c = { RDF.type => [OT.ErrorReport], OT.statusCode => @http_code, OT. => @message, OT.actor => @actor, OT.errorCode => @errorType, } c[OT.errorCause] = @errorCause.rdf_content if @errorCause c end |
#to_rdfxml ⇒ Object
82 83 84 85 86 |
# File 'lib/error.rb', line 82 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 |
#to_yaml_properties ⇒ Object
overwrite sorting to make easier readable
63 64 65 66 67 68 |
# File 'lib/error.rb', line 63 def to_yaml_properties p = super p = ( p - ["@backtrace"]) + ["@backtrace"] if @backtrace p = ( p - ["@errorCause"]) + ["@errorCause"] if @errorCause p end |