Skip to content

Commit

Permalink
fix(examples): avoid swallowing errors in example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and rattrayalex committed Jul 10, 2023
1 parent c4eb4d7 commit e406dfb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion examples/cancellation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ async function main() {
}
}

main().catch(console.error);
main().catch((err) => {
console.error(err);
process.exit(1);
});
5 changes: 4 additions & 1 deletion examples/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ async function main() {
console.log(result.completion);
}

main().catch(console.error);
main().catch((err) => {
console.error(err);
process.exit(1);
});
5 changes: 4 additions & 1 deletion examples/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ async function main() {
}
}

main().catch(console.error);
main().catch((err) => {
console.error(err);
process.exit(1);
});

0 comments on commit e406dfb

Please sign in to comment.