EXT-1403-nicer-error-message-to-replace-the-one-from-the-failing-fieldtype-wrapper-js #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Nicer error message from failing
fieldtype-wrapper.js
.Replaces the uncaught error from #107
with
Why?
When a client upload code to the field plugin editor, Storyblok will serve a document with a script that contains that code. But the content of the script element will not be exactly the code that the client uploaded; it will be appended with a code snippet from Storyblok. For example, the if the client uploads
Storyblok will serve a document with
This last part causes an error to be thrown. The only way to prevent these last three lines from being executed is by throwing an error before it's executed.
For Storyblok internals, see the feature requests:
How to test? (optional)
Build one of the templates and upload the export bundle to the field plugin editor. You should see the new error message instead, and the app should load normally.