• Sean Hammond's avatar
    Don't throw on invalid JSON · a6869f48
    Sean Hammond authored
    Don't throw an error when parsing an invalid js-hypothesis-config JSON
    script.
    
    This error thrown by shared.settings#jsonConfigsFrom() was caught in one
    of the places where that function is called, but not in other places
    where it's called.
    
    Move the error catching and warning logging into the shared function
    instead.
    
    This now means, for example, that boot/index.js no longer crashes
    (bringing down the entire app) if the host page contains an invalid
    js-hypothesis-config.
    
    Unfortunately since jsonConfigsFrom() is called _twice_ on page load to
    read the same js-hypothesis-config objects from the host page (it's
    called once by boot/index.js and once by annotator/config/config.js) if
    there's an invalid js-hypothesis-config a warning about it will be
    logged twice.
    a6869f48
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...