@@ -34,6 +34,7 @@ import {
3434import { LOG_LEVELS , LogLevel } from "@fern-api/logger" ;
3535import { askToLogin , login , logout } from "@fern-api/login" ;
3636import { protocGenFern } from "@fern-api/protoc-gen-fern" ;
37+ import { CliError } from "@fern-api/task-context" ;
3738import getPort from "get-port" ;
3839import { Argv } from "yargs" ;
3940import { hideBin } from "yargs/helpers" ;
@@ -85,7 +86,6 @@ import { FERN_CWD_ENV_VAR } from "./cwd.js";
8586import { rerunFernCliAtVersion } from "./rerunFernCliAtVersion.js" ;
8687import { resolveGroupGithubConfig } from "./resolveGroupGithubConfig.js" ;
8788import { RUNTIME } from "./runtime.js" ;
88- import { CliError } from "@fern-api/task-context" ;
8989
9090void runCli ( ) ;
9191
@@ -375,7 +375,9 @@ function addInitCommand(cli: Argv<GlobalCliOptions>, cliContext: CliContext) {
375375 const result = await loadOpenAPIFromUrl ( { url : argv . openapi , logger : cliContext . logger } ) ;
376376
377377 if ( result . status === LoadOpenAPIStatus . Failure ) {
378- cliContext . failAndThrow ( result . errorMessage , undefined , { code : CliError . Code . NetworkError } ) ;
378+ cliContext . failAndThrow ( result . errorMessage , undefined , {
379+ code : CliError . Code . NetworkError
380+ } ) ;
379381 }
380382
381383 const tmpFilepath = result . filePath ;
@@ -3091,7 +3093,10 @@ function parseOwnerRepo(githubRepo: string): { owner: string; repo: string } {
30913093 const owner = parts [ parts . length - 2 ] ;
30923094 const repo = parts [ parts . length - 1 ] ;
30933095 if ( owner == null || repo == null ) {
3094- throw new CliError ( { message : `Could not parse owner/repo from: ${ githubRepo } ` , code : CliError . Code . ParseError } ) ;
3096+ throw new CliError ( {
3097+ message : `Could not parse owner/repo from: ${ githubRepo } ` ,
3098+ code : CliError . Code . ParseError
3099+ } ) ;
30953100 }
30963101 return { owner , repo } ;
30973102}
0 commit comments