@@ -3,7 +3,6 @@ import { addPrefixToString } from "@fern-api/core-utils";
33import { createLogger , LogLevel } from "@fern-api/logger" ;
44import {
55 CliError ,
6- type CliErrorCode ,
76 CreateInteractiveTaskParams ,
87 Finishable ,
98 InteractiveTaskContext ,
@@ -29,7 +28,7 @@ export declare namespace TaskContextImpl {
2928 onResult ?: ( result : TaskResult ) => void ;
3029 shouldBufferLogs : boolean ;
3130 instrumentPostHogEvent : ( event : PosthogEvent ) => void ;
32- captureException ?: ( error : unknown , code ?: CliErrorCode ) => void ;
31+ captureException ?: ( error : unknown , code ?: CliError . Code ) => void ;
3332 }
3433}
3534
@@ -43,7 +42,7 @@ export class TaskContextImpl implements Startable<TaskContext>, Finishable, Task
4342 protected status : "notStarted" | "running" | "finished" = "notStarted" ;
4443 private onResult : ( ( result : TaskResult ) => void ) | undefined ;
4544 private instrumentPostHogEventImpl : ( event : PosthogEvent ) => void ;
46- private captureExceptionImpl ?: ( error : unknown , code ?: CliErrorCode ) => void ;
45+ private captureExceptionImpl ?: ( error : unknown , code ?: CliError . Code ) => void ;
4746 public constructor ( {
4847 logImmediately,
4948 logPrefix,
@@ -83,13 +82,13 @@ export class TaskContextImpl implements Startable<TaskContext>, Finishable, Task
8382
8483 public takeOverTerminal : ( run : ( ) => void | Promise < void > ) => Promise < void > ;
8584
86- public failAndThrow ( message ?: string , error ?: unknown , options ?: { code ?: CliErrorCode } ) : never {
85+ public failAndThrow ( message ?: string , error ?: unknown , options ?: { code ?: CliError . Code } ) : never {
8786 this . failWithoutThrowing ( message , error , options ) ;
8887 this . finish ( ) ;
8988 throw new TaskAbortSignal ( ) ;
9089 }
9190
92- public failWithoutThrowing ( message ?: string , error ?: unknown , options ?: { code ?: CliErrorCode } ) : void {
91+ public failWithoutThrowing ( message ?: string , error ?: unknown , options ?: { code ?: CliError . Code } ) : void {
9392 this . result = TaskResult . Failure ;
9493
9594 if ( error instanceof TaskAbortSignal ) {
@@ -116,7 +115,7 @@ export class TaskContextImpl implements Startable<TaskContext>, Finishable, Task
116115 }
117116 }
118117
119- public captureException ( error : unknown , code ?: CliErrorCode ) : void {
118+ public captureException ( error : unknown , code ?: CliError . Code ) : void {
120119 this . captureExceptionImpl ?.( error , code ) ;
121120 }
122121
0 commit comments