lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb in adiwg-mdtranslator-2.13.0 vs lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb in adiwg-mdtranslator-2.13.1
- old
+ new
@@ -1,10 +1,10 @@
# unpack citation
# Reader - ADIwg JSON to internal data structure
# History:
-# Stan Smith 2018-02-19 refactored error and warning messaging
+# Stan Smith 2018-06-26 refactored error and warning messaging
# Stan Smith 2016-12-09 original script
require_relative 'module_citation'
module ADIWG
@@ -14,13 +14,15 @@
module TaxonomicSystem
def self.unpack(hSystem, responseObj)
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
+
# return nil object if input is empty
if hSystem.empty?
- responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: taxonomic system object is empty'
+ @MessagePath.issueWarning(820, responseObj)
return nil
end
# instance classes needed in script
intMetadataClass = InternalMetadata.new
@@ -35,12 +37,10 @@
intSystem[:citation] = hReturn
end
end
end
if intSystem[:citation].empty?
- responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: taxonomic system citation is missing'
- responseObj[:readerExecutionPass] = false
- return nil
+ @MessagePath.issueError(821, responseObj)
end
# taxonomy system - modifications
if hSystem.has_key?('modifications')
unless hSystem['modifications'] == ''