-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from aeternity/feature/update-sdk
Release v6.0.1 with [email protected]
- Loading branch information
Showing
9 changed files
with
38 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
#!/usr/bin/env node | ||
import { RestError } from '@azure/core-rest-pipeline'; | ||
import { InvalidPasswordError, NodeInvocationError, ContractError } from '@aeternity/aepp-sdk'; | ||
import { setCommandOptions } from './utils/config.js'; | ||
import { prepareOptions } from './utils/default-option-description.js'; | ||
import CliError from './utils/CliError.js'; | ||
import program from './commands/main.js'; | ||
import { runProgram } from './utils/CliError.js'; | ||
|
||
await runProgram(program); | ||
try { | ||
prepareOptions(program); | ||
await setCommandOptions(program); | ||
await program.parseAsync(); | ||
} catch (error) { | ||
if ( | ||
error instanceof CliError | ||
|| error instanceof RestError | ||
|| error instanceof InvalidPasswordError | ||
|| error instanceof NodeInvocationError | ||
|| (error instanceof ContractError && error.message.includes('ACI doesn\'t match called contract')) | ||
|| error.code === 'ENOENT' | ||
) program.error(error.message); | ||
else throw error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,6 @@ | ||
import { RestError } from '@azure/core-rest-pipeline'; | ||
import { InvalidPasswordError, NodeInvocationError } from '@aeternity/aepp-sdk'; | ||
import { setCommandOptions } from './config.js'; | ||
import { prepareOptions } from './default-option-description.js'; | ||
|
||
export default class CliError extends Error { | ||
constructor(message) { | ||
super(message); | ||
this.name = 'CliError'; | ||
} | ||
} | ||
|
||
export async function runProgram(program) { | ||
try { | ||
prepareOptions(program); | ||
await setCommandOptions(program); | ||
await program.parseAsync(); | ||
} catch (error) { | ||
if ( | ||
error instanceof CliError | ||
|| error instanceof RestError | ||
|| error instanceof InvalidPasswordError | ||
|| error instanceof NodeInvocationError | ||
|| error.code === 'ENOENT' | ||
) { | ||
program.error(error.message); | ||
return; | ||
} | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters