Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better exception message #20

Open
konuch opened this issue Dec 11, 2018 · 1 comment
Open

Better exception message #20

konuch opened this issue Dec 11, 2018 · 1 comment

Comments

@konuch
Copy link

konuch commented Dec 11, 2018

When extractor tries to extract a given line which contains syntaxt error, for example it contains

translate.instant('test1' + 'text2')

, it fails with following error, which is alright:

.\node_modules\gettext-extractor\dist\js\extractors\factories\callExpression.js:93
    let concatenated = ts.createStringLiteral('');
                                       ^
TypeError: ts.createStringLiteral is not a function

However, the stacktrace does not contain any relevant information about the file and line number, where the extraction failed.

Would it be possible to include this information somehow, so developer knows where he made an error? Maybe adding some try/catch block.

Thanks in advance.

@lukasgeiter
Copy link
Owner

Thanks, that's a good suggestion. I'll see if I can improve this in a future release...


With the error you posted you've actually found a bug. Concatenated strings are supported, but there was an issue with TypeScript 2.8 and lower. The bug is now fixed in release v3.4.1.

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

No branches or pull requests

2 participants