From 97d39cf958ecb9d7b35073a9a56945552073b678 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 18 Feb 2013 10:09:16 +0000 Subject: changed content-type to application/x-turtle for large imports --- lib/4store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/4store.rb b/lib/4store.rb index e6eb914..338573d 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -3,7 +3,7 @@ module OpenTox class FourStore @@accept_formats = [ "application/rdf+xml", "text/turtle", "text/plain", "text/uri-list", "text/html", 'application/sparql-results+xml' ] - @@content_type_formats = [ "application/rdf+xml", "text/turtle", "text/plain" ] + @@content_type_formats = [ "application/rdf+xml", "text/turtle", "text/plain", "application/x-turtle" ] def self.list mime_type bad_request_error "'#{mime_type}' is not a supported mime type. Please specify one of #{@@accept_formats.join(", ")} in the Accept Header." unless @@accept_formats.include? mime_type -- cgit v1.2.3 From 7169fcdea7271ac87a9a67783b0b08a092106d34 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 21 Feb 2013 16:18:31 +0100 Subject: OpenTox error handling for NoMethodError --- lib/error.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/error.rb b/lib/error.rb index 3dd2950..51168f4 100644 --- a/lib/error.rb +++ b/lib/error.rb @@ -1,7 +1,7 @@ require 'open4' # add additional fields to Exception class to format errors according to OT-API -class RuntimeError +module OpenToxError attr_accessor :http_code, :uri def initialize message, uri=nil super message @@ -46,6 +46,14 @@ class RuntimeError end +class RuntimeError + include OpenToxError +end + +class NoMethodError + include OpenToxError +end + module OpenTox class Error < RuntimeError -- cgit v1.2.3 From 6d1520b5662b8371a674bbd24b392fd794aa26be Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 21 Feb 2013 18:21:18 +0100 Subject: OpenTox error handling removed from NoMethodError --- lib/error.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/error.rb b/lib/error.rb index 51168f4..4fed343 100644 --- a/lib/error.rb +++ b/lib/error.rb @@ -50,9 +50,10 @@ class RuntimeError include OpenToxError end -class NoMethodError - include OpenToxError -end +# clutters log file with library errors +#class NoMethodError + #include OpenToxError +#end module OpenTox -- cgit v1.2.3 From 4ba2cc9849473f97baf75195bb36c5057f1c58d4 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Fri, 22 Feb 2013 10:39:56 +0100 Subject: fix pending log messages for non-runtime errors --- lib/task.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/task.rb b/lib/task.rb index 3d427bc..82e1665 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -21,6 +21,7 @@ module OpenTox rescue unless $!.is_a?(RuntimeError) # PENDING: only runtime Errors are logged when raised cut_index = $!.backtrace.find_index{|line| line.match /gems\/sinatra/} + cut_index = -1 unless cut_index msg = "\nTask ERROR\n"+ "task description: #{params[RDF::DC.description]}\n"+ "task uri: #{$!.class.to_s}\n"+ -- cgit v1.2.3