Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better error message for missing snapshot on extension #1499

Open
mint-thompson opened this issue Aug 6, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@mint-thompson
Copy link
Collaborator

There are cases where a missing snapshot on an extension may cause a stack trace due to an uncaught exception:

debug TypeError: Cannot read properties of undefined (reading 'element')
    at isModifierExtension (/usr/local/lib/node_modules/fsh-sushi/dist/fhirtypes/common.js:1205:93)
    at /usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:921:69
    at Array.forEach (<anonymous>)
    at StructureDefinitionExporter.handleExtensionContainsRule (/usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:883:20)
    at StructureDefinitionExporter.setRules (/usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:674:34)
    at StructureDefinitionExporter.exportStructDef (/usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:1111:14)
    at /usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:1170:22
    at Array.forEach (<anonymous>)
    at StructureDefinitionExporter.export (/usr/local/lib/node_modules/fsh-sushi/dist/export/StructureDefinitionExporter.js:1168:30)
    at FHIRExporter.export (/usr/local/lib/node_modules/fsh-sushi/dist/export/FHIRExporter.js:27:48)

When using an extension definition that does not have a snapshot, the normal "missing snapshot" message should be provided.

Originally reported at https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/pre-adopt.20R5.20in.20R4.3B.20pre.20defined.20resources.3F

@mint-thompson mint-thompson added the bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant