@@ -2,7 +2,7 @@ import { diffSemverOrThrow } from "@fern-api/core-utils";
22import { AbsoluteFilePath , cwd , doesPathExist , resolve , streamObjectFromFile } from "@fern-api/fs-utils" ;
33import { IntermediateRepresentation , serialization } from "@fern-api/ir-sdk" ;
44import { IntermediateRepresentationChangeDetector } from "@fern-api/ir-utils" ;
5- import { FernCliError } from "@fern-api/task-context" ;
5+ import { TaskAbortSignal } from "@fern-api/task-context" ;
66import semver from "semver" ;
77
88import { CliContext } from "../../cli-context/CliContext.js" ;
@@ -57,7 +57,7 @@ export async function diff({
5757 const nextVersion = semver . inc ( fromVersion , bump ) ;
5858 if ( ! nextVersion ) {
5959 context . failWithoutThrowing ( `Invalid current version: ${ fromVersion } ` ) ;
60- throw new FernCliError ( ) ;
60+ throw new TaskAbortSignal ( ) ;
6161 }
6262 return { bump, nextVersion, errors } ;
6363}
@@ -74,13 +74,13 @@ async function readIr({
7474 const absoluteFilepath = AbsoluteFilePath . of ( resolve ( cwd ( ) , filepath ) ) ;
7575 if ( ! ( await doesPathExist ( absoluteFilepath , "file" ) ) ) {
7676 context . failWithoutThrowing ( `File not found: ${ absoluteFilepath } ` ) ;
77- throw new FernCliError ( ) ;
77+ throw new TaskAbortSignal ( ) ;
7878 }
7979 const ir = await streamObjectFromFile ( absoluteFilepath ) ;
8080 const parsed = serialization . IntermediateRepresentation . parse ( ir ) ;
8181 if ( ! parsed . ok ) {
8282 context . failWithoutThrowing ( `Invalid --${ flagName } ; expected a filepath containing a valid IR` ) ;
83- throw new FernCliError ( ) ;
83+ throw new TaskAbortSignal ( ) ;
8484 }
8585 return parsed . value ;
8686}
@@ -162,7 +162,7 @@ export function diffGeneratorVersions(
162162 } ;
163163 } catch ( error ) {
164164 context . failWithoutThrowing ( `Error diffing generator versions ${ from } and ${ to } : ${ error } ` ) ;
165- throw new FernCliError ( ) ;
165+ throw new TaskAbortSignal ( ) ;
166166 }
167167}
168168
0 commit comments