-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix Component Viewer When Invalid URLs are Loaded #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes requested.
This probably should have gone straight into the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tuckerzp you need to fix your commits' author data on this branch. Perhaps that'd be a good time to reorg to be on top of develop
instead of EGRC-261
.
OSCALLoader did not catch errors thrown in OSCALComponentDefinition. When created, OSCALComponentDefinition is now passed an onError() function. OSCALLoader catches that error and displays the existing, defined error of: "Something went wrong loading the OSCAL data"
OSCALComponentDefinition was setting the error and did nothing with it when resolving sources. It now throws the error to OSCALLoader.
@rgauss with @kylelaker's help, I changed the branch we are merging into to |
OSCALComponent
was setting an error without dealing with it. This caused the Component Viewer to not load at all when loading an invalid default URL.OSCALLoader
now passes anonError()
function toOSCALComponent
that allows:OSCALComponent
to throw an errorOSCALLoader
to catch that errorOSCALLoader
displays the existing, defined error of:"Something went wrong loading the OSCAL data {error}"
Testing
By default the Component should display an error due to the issue usnistgov/oscal-content#69.
To test a successful component you must:
public
folderdefaultOSCALComponentUrl
inOSCALLoader
to:const defaultOSCALComponentUrl = http://localhost:3000/example-component.json