Skip to content

Commit

Permalink
Add descriptive error message if model cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Osborne authored and Luke Osborne committed Jun 26, 2019
1 parent 7da58c6 commit 717f2e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/measure-loader/source_data_criteria_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def modelize_data_criteria_entry(entry)
extract_fields_from_single_code_reference_data_criteria(criteria)
end
hqmf_template_oid = criteria.at_css('templateId/item')['root']
model = QDM::ModelFinder.by_hqmf_oid(hqmf_template_oid).new(model_fields)
model = QDM::ModelFinder.by_hqmf_oid(hqmf_template_oid)
raise "No datatype found for oid #{hqmf_template_oid}. Verify the QDM version of the measure package is correct." if model.nil?
model = model.new(model_fields)
model.description = model.qdmTitle + ': ' + model.description
return model
end
Expand Down

0 comments on commit 717f2e1

Please sign in to comment.