Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ export interface GlobalOptions {
input?: string | string[];
output?: string;
failOnWarnings?: boolean;
throwOnError?: boolean;
}

export interface Tsconfig {
Expand Down
9 changes: 9 additions & 0 deletions packages/orval/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
await generateSpec(workspace, normalizedOptions, projectName);
} catch (error) {
hasErrors = true;
if (options?.throwOnError) {
throw error;
}
logError(error, projectName);
Comment on lines +42 to 45
}

Expand Down Expand Up @@ -88,6 +91,9 @@
try {
await generateSpec(workspace, normalizedOptions);
} catch (error) {
if (options?.throwOnError) {
throw error;
}
logError(error);
}

Expand All @@ -99,6 +105,9 @@
try {
await generateSpec(workspace, normalizedOptions);
} catch (error) {
if (options?.throwOnError) {

Check failure on line 108 in packages/orval/src/generate.ts

View workflow job for this annotation

GitHub Actions / pr-checks (ubuntu-latest, 22.x)

Unnecessary optional chain on a non-nullish value
throw error;
}
logError(error);
}
if (options.failOnWarnings && getWarningCount() > 0) {
Expand Down
Loading