Skip to content

Commit

Permalink
Revert "Remove unnecessary try/catch" (#21690)
Browse files Browse the repository at this point in the history
This reverts commit 4179376.
  • Loading branch information
aduth committed Apr 20, 2020
1 parent 5b1fa3a commit d69aae1
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions bin/api-docs/update-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,31 @@ glob.stream( [
// so the tokens must be replaced in sequence to prevent the processes
// from overriding each other.
for ( const [ token, path ] of tokens ) {
await execa(
join( __dirname, '..', '..', 'node_modules', '.bin', 'docgen' ),
[
relative( ROOT_DIR, resolve( dirname( file ), path ) ),
`--output ${ output }`,
'--to-token',
`--use-token "${ token }"`,
'--ignore "/unstable|experimental/i"',
],
{ shell: true }
);
try {
await execa(
join(
__dirname,
'..',
'..',
'node_modules',
'.bin',
'docgen'
),
[
relative( ROOT_DIR, resolve( dirname( file ), path ) ),
`--output ${ output }`,
'--to-token',
`--use-token "${ token }"`,
'--ignore "/unstable|experimental/i"',
],
{ shell: true }
);
} catch ( error ) {
// Disable reason: Errors should log to console.

// eslint-disable-next-line no-console
console.error( error );
process.exit( 1 );
}
}
} );

0 comments on commit d69aae1

Please sign in to comment.