File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 44import * as os from 'os' ;
55
66import { CommandLineParser , type CommandLineFlagParameter } from '@rushstack/ts-command-line' ;
7- import { InternalError } from '@rushstack/node-core-library' ;
7+ import { AlreadyReportedError , InternalError } from '@rushstack/node-core-library' ;
88import { Colorize } from '@rushstack/terminal' ;
99
1010import { RunAction } from './RunAction' ;
@@ -42,10 +42,12 @@ export class ApiExtractorCommandLine extends CommandLineParser {
4242 await super . onExecuteAsync ( ) ;
4343 process . exitCode = 0 ;
4444 } catch ( error ) {
45- if ( this . _debugParameter . value ) {
46- console . error ( os . EOL + error . stack ) ;
47- } else {
48- console . error ( os . EOL + Colorize . red ( 'ERROR: ' + error . message . trim ( ) ) ) ;
45+ if ( ! ( error instanceof AlreadyReportedError ) ) {
46+ if ( this . _debugParameter . value ) {
47+ console . error ( os . EOL + error . stack ) ;
48+ } else {
49+ console . error ( os . EOL + Colorize . red ( 'ERROR: ' + error . message . trim ( ) ) ) ;
50+ }
4951 }
5052 }
5153 }
Original file line number Diff line number Diff line change 33
44import * as os from 'os' ;
55import * as path from 'path' ;
6- import { PackageJsonLookup , FileSystem , type IPackageJson , Path } from '@rushstack/node-core-library' ;
6+ import {
7+ PackageJsonLookup ,
8+ FileSystem ,
9+ type IPackageJson ,
10+ Path ,
11+ AlreadyReportedError
12+ } from '@rushstack/node-core-library' ;
713import { Colorize } from '@rushstack/terminal' ;
814import {
915 CommandLineAction ,
@@ -138,13 +144,12 @@ export class RunAction extends CommandLineAction {
138144 if ( extractorResult . succeeded ) {
139145 console . log ( os . EOL + 'API Extractor completed successfully' ) ;
140146 } else {
141- process . exitCode = 1 ;
142-
143147 if ( extractorResult . errorCount > 0 ) {
144148 console . log ( os . EOL + Colorize . red ( 'API Extractor completed with errors' ) ) ;
145149 } else {
146150 console . log ( os . EOL + Colorize . yellow ( 'API Extractor completed with warnings' ) ) ;
147151 }
152+ throw new AlreadyReportedError ( ) ;
148153 }
149154 }
150155}
Original file line number Diff line number Diff line change 1+ {
2+ "changes" : [
3+ {
4+ "packageName" : " @microsoft/api-extractor" ,
5+ "comment" : " Fixes API extractor error handling when changed APIs are encountered and the \" --local\" flag is not specified" ,
6+ "type" : " patch"
7+ }
8+ ],
9+ "packageName" : " @microsoft/api-extractor"
10+ }
You can’t perform that action at this time.
0 commit comments