diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-26 15:58:18 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-26 15:58:18 +0100 |
commit | 9750da9cb7dc14309be38f98bc0b50c8bff9eb72 (patch) | |
tree | 8b2ce119a932b6b0b35555eeb551e8ecb6bd35bc /report/report_persistance.rb | |
parent | 3af7a871c60fb7d853edd348634d6603fccec101 (diff) |
adjust to new A&A for GET, remove old Report-Errorreporting
Diffstat (limited to 'report/report_persistance.rb')
-rwxr-xr-x | report/report_persistance.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/report/report_persistance.rb b/report/report_persistance.rb index 808547d..df4930c 100755 --- a/report/report_persistance.rb +++ b/report/report_persistance.rb @@ -100,7 +100,7 @@ class Reports::FileReportPersistance < Reports::ReportPersistance report_dir = report_directory(type, id) raise_report_not_found(type, id) unless File.directory?(report_dir) file_path = report_dir+"/"+resource.to_s - raise Reports::NotFound.new("resource not found, resource: '"+resource.to_s+"', type:'"+type.to_s+"', id:'"+id.to_s+"'") unless File.exist?(file_path) + raise OpenTox::NotFoundError.new("resource not found, resource: '"+resource.to_s+"', type:'"+type.to_s+"', id:'"+id.to_s+"'") unless File.exist?(file_path) return file_path end @@ -162,7 +162,7 @@ class Reports::FileReportPersistance < Reports::ReportPersistance private def raise_report_not_found(type, id) - raise Reports::NotFound.new("report not found, type:'"+type.to_s+"', id:'"+id.to_s+"'") + raise OpenTox::NotFoundError.new("report not found, type:'"+type.to_s+"', id:'"+id.to_s+"'") end def type_directory(type) @@ -270,11 +270,11 @@ module Reports def get_report(type, id, format, force_formating, params) report = ReportData.first({:id => id, :report_type => type}) - raise Reports::NotFound.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") unless report + raise OpenTox::NotFoundError.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") unless report # begin # report = ReportData.find(:first, :conditions => {:id => id, :report_type => type}) # rescue ActiveRecord::RecordNotFound -# raise Reports::NotFound.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") +# raise OpenTox::NotFoundError.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") # end case format @@ -291,11 +291,11 @@ module Reports # begin # report = ReportData.find(:first, :conditions => {:id => id, :report_type => type}) # rescue ActiveRecord::RecordNotFound -# raise Reports::NotFound.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") +# raise OpenTox::NotFoundError.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") # end # ReportData.delete(id) report = ReportData.first({:id => id, :report_type => type}) - raise Reports::NotFound.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") unless report + raise OpenTox::NotFoundError.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") unless report report.destroy if (subjectid) begin |