The ch5-template component will throw an error if something common happens, the examples below cover some
of common cases.
In the following examples, when no error occurs, the template containing the replacement content text
will be
generated.
You will need to open the browser console to visualize the errors, the example below are just for showcase
purposes, the ch5-template
will not state on the UI the error message.
original content
-
No templateId and context is provided:
[ch5-template] Error: No templateId was provided
-
Template with the id provided in templateId does not exist:
[ch5-template] Error: No template with the id: "invalidId" found
-
The context attribute is optional, therefore the following scenarios are valid:
-
Invalid context structure, the template will be generated but nothing will be renamed
[ch5-template] Warning: Invalid context pair structure, expected:
"original:replacement", but received ",replacement", moving to the next context pair
-
A valid templateId and context is provided:
-
The template provided has no content:
[ch5-template] Error: The provided template with the id:
"templateWithNoContent" has no content