File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,15 +13,17 @@ export function parseOutputArg(outputArg: string): schemas.OutputObjectSchema {
1313 if ( isGitUrl ( outputArg ) ) {
1414 const token = process . env . GITHUB_TOKEN ?? process . env . GIT_TOKEN ;
1515 if ( token == null ) {
16+
1617 throw new CliError ( {
1718 message :
1819 `A git token is required when --output is a git URL.\n\n` +
1920 ` Set GITHUB_TOKEN or GIT_TOKEN:\n` +
2021 ` export GITHUB_TOKEN=ghp_xxx\n\n` +
2122 ` Or use a local path:\n` +
2223 ` --output ./my-sdk` ,
23- code : CliError . Code . InternalError
24+ code : CliError . Code . ConfigError
2425 } ) ;
26+
2527 }
2628 return {
2729 git : {
Original file line number Diff line number Diff line change @@ -712,10 +712,12 @@ export class Wizard {
712712 private async fetchApiFromUrl ( url : string , specFormat : FernYmlBuilder . SpecFormat ) : Promise < Wizard . ApiSource > {
713713 const response = await fetch ( url , { signal : AbortSignal . timeout ( FETCH_API_SPEC_REQUEST_TIMEOUT_MS ) } ) ;
714714 if ( ! response . ok ) {
715+
715716 throw new CliError ( {
716717 message : `HTTP ${ response . status } ${ response . statusText } ` ,
717- code : CliError . Code . InternalError
718+ code : CliError . Code . NetworkError
718719 } ) ;
720+
719721 }
720722 const content = await response . text ( ) ;
721723 const filename = this . resolveFilenameFromUrl ( { url, specFormat } ) ;
You can’t perform that action at this time.
0 commit comments