-
Notifications
You must be signed in to change notification settings - Fork 8
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
How to catch runSync() exception #47
Comments
the throwOnError options just exits node process with error 1, not 0 (success), to make something like travis to react. var TypeHelper = require('./dist/commonjs/index.js').TypeHelper
// sync run
let checkerSync = TypeHelper({
tsConfig: './tsconfig.json',
basePath: './',
tsLint: './tslint.json',
name: 'checkerSync'
});
let noErrors = checkerSync.runSync()
if (noErrors) {
console.log('on no, I have: ' + noErrors + ' errors');
} else {
console.log('all OK :-)');
}
@mickaelmartinsdev |
Documentation needs to be clearer for standard test cases |
@vegarringdal actually this is a big issue now I'm trying to pipe error output to somewhere else. Returning a number isn't enough, it should be an array of strings. If length 0, then 0 errors. |
I didnt see this before now. |
added a getresult function https://github.com/fuse-box/fuse-box-typechecker/blob/master/src/index.ts#L80-L83 please make a PR with edits to this function with the array data you would like to see fuse-box-typechecker/src/printResult.ts Lines 13 to 58 in d9b9fbb
|
Hi,
I want to catch 'exception' when TypeHelper throws exception. How I can do that ?
try{ testSync.runSync(); }catch(error) { console.log('error : '+ error); }
Thank-you
The text was updated successfully, but these errors were encountered: