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 4
4
import * as os from 'os' ;
5
5
6
6
import { 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' ;
8
8
import { Colorize } from '@rushstack/terminal' ;
9
9
10
10
import { RunAction } from './RunAction' ;
@@ -42,10 +42,12 @@ export class ApiExtractorCommandLine extends CommandLineParser {
42
42
await super . onExecuteAsync ( ) ;
43
43
process . exitCode = 0 ;
44
44
} 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
+ }
49
51
}
50
52
}
51
53
}
Original file line number Diff line number Diff line change 3
3
4
4
import * as os from 'os' ;
5
5
import * 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' ;
7
13
import { Colorize } from '@rushstack/terminal' ;
8
14
import {
9
15
CommandLineAction ,
@@ -138,13 +144,12 @@ export class RunAction extends CommandLineAction {
138
144
if ( extractorResult . succeeded ) {
139
145
console . log ( os . EOL + 'API Extractor completed successfully' ) ;
140
146
} else {
141
- process . exitCode = 1 ;
142
-
143
147
if ( extractorResult . errorCount > 0 ) {
144
148
console . log ( os . EOL + Colorize . red ( 'API Extractor completed with errors' ) ) ;
145
149
} else {
146
150
console . log ( os . EOL + Colorize . yellow ( 'API Extractor completed with warnings' ) ) ;
147
151
}
152
+ throw new AlreadyReportedError ( ) ;
148
153
}
149
154
}
150
155
}
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