You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
slide.addText([{text: undefined, options: {breakLine: true}}], {x:1, y:1, w: 1, h:1})
} catch (e) {
console.log('this will not be invoked')
console.error(e)
}
Fails with:
(node:63649) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
Note that the error only happens when actually writing the output, not at the time you call addSlide.
I agree that it would be useful to know which slide had the issue, but that seems like a lot of error checking that would need to be added.
The TypeScript definitions define that text must not be null/undefined, so if you use TypeScript and have proper types everywhere in your app there's a good chance that you'll be able to catch the error at development time rather than at runtime.
node code:
Fails with:
Example to reproduce in browser:
Fiddle: https://jsfiddle.net/6ayzoxh2/
Clearly this is an error on my side, and I should not pass the undefined text, but it would be cool if your code would throw, then I could handle it
The text was updated successfully, but these errors were encountered: