aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/src/utils/index.ts')
-rw-r--r--packages/pipeline/src/utils/index.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/pipeline/src/utils/index.ts b/packages/pipeline/src/utils/index.ts
index ebc1f8e0f..4242e0437 100644
--- a/packages/pipeline/src/utils/index.ts
+++ b/packages/pipeline/src/utils/index.ts
@@ -6,3 +6,17 @@ export function bigNumbertoStringOrNull(n: BigNumber): string | null {
}
return n.toString();
}
+
+export function handleError(e: any): void {
+ if (e.message != null) {
+ console.error(e.message);
+ } else {
+ console.error('Unknown error');
+ }
+ if (e.stack != null) {
+ console.error(e.stack);
+ } else {
+ console.error('(No stack trace)');
+ }
+ process.exit(1);
+}