Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

catch exceptions and show them somewhere #6

Open
ajafff opened this issue Apr 10, 2018 · 2 comments
Open

catch exceptions and show them somewhere #6

ajafff opened this issue Apr 10, 2018 · 2 comments

Comments

@ajafff
Copy link

ajafff commented Apr 10, 2018

https://agentcooper.github.io/typescript-play/#code/JYMwBAFAQg9jA2BTAhgOwgSgwKDHsALgJ4AOiYAKmALxhpFA

Throws an exception, because TypeScript currently doesn't handle this correctly. That's already tracked in the TypeScript repo.

Uncaught Error: Cannot read property 'kind' of undefined

TypeError: Cannot read property 'kind' of undefined
    at Object.e.isBlock (typescriptServices.js:7)
    at _t (typescriptServices.js:7)
    at typescriptServices.js:7
    at V (typescriptServices.js:7)
    at emitNodeWithSourceMap (typescriptServices.js:7)
    at q (typescriptServices.js:7)
    at b (typescriptServices.js:7)
    at emitNodeWithComments (typescriptServices.js:7)
    at U (typescriptServices.js:7)
    at emitNodeWithNotification (typescriptServices.js:7)
    at Object.e.isBlock (typescriptServices.js:7)
    at _t (typescriptServices.js:7)
    at typescriptServices.js:7
    at V (typescriptServices.js:7)
    at emitNodeWithSourceMap (typescriptServices.js:7)
    at q (typescriptServices.js:7)
    at b (typescriptServices.js:7)
    at emitNodeWithComments (typescriptServices.js:7)
    at U (typescriptServices.js:7)
    at emitNodeWithNotification (typescriptServices.js:7)
    at errors.ts:81

As a regular user I don't notice this exception without opening devtools. I only see that transpiling stops at a certain point.
It would be nice to get this exception displayed somewhere on the website.

@agentcooper
Copy link
Owner

Do you want a full exception message or just an indicator that it happened and you might need to check the console?

@ajafff
Copy link
Author

ajafff commented Apr 12, 2018

An indicator would work for me. But you could actually use the space where the transpiled output is shown to display the full stack trace since there will be no transpilation in case of an exception.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants