When signing transaction using --offline flag, if there is any error, the real error message is replaced by an incorrect and misleading error:
Application at data path <data-path> is not running.
This makes no sense, because a running node is not needed for offline signing. Even worse, this misleading error makes it very difficult for a user to understand what the real error is.
Expected behavior
Command should return the correct error, which will help the user correct the command input.
Steps to reproduce
While a node is not running, sign transaction offline and provide an invalid value for a flag, e.g. key derivation path:
In this case, the expected error is that key derivation path is invalid.
Which version(s) does this affect? (Environment, OS, etc...)
The latest SDK 6.0 version.
How to fix it
The transaction:sign command contains custom logic which re-throws a custom error if application is not running:
if (error) {
if (this._dataPath && !isApplicationRunning(this._dataPath)) {
throw new Error(`Application at data path ${this._dataPath} is not running.`);
}
this.error(error instanceof Error ? error.message : error);
}
This does not correctly cover the case when signing is done in offline mode. Furthermore, this custom logic is not even needed. The check if the application is running is already correctly done when getting the API client, and that function throws the correct error:
Since the concept of a "path" could mean different things, it would be nice to make the invalid key derivation path error message more specific by changing it from Invalid path format into Invalid key derivation path format.
Actual behavior
When signing transaction using
--offline
flag, if there is any error, the real error message is replaced by an incorrect and misleading error:This makes no sense, because a running node is not needed for offline signing. Even worse, this misleading error makes it very difficult for a user to understand what the real error is.
Expected behavior
Command should return the correct error, which will help the user correct the command input.
Steps to reproduce
While a node is not running, sign transaction offline and provide an invalid value for a flag, e.g. key derivation path:
In this case, the expected error is that key derivation path is invalid.
Which version(s) does this affect? (Environment, OS, etc...)
The latest SDK 6.0 version.
How to fix it
The
transaction:sign
command contains custom logic which re-throws a custom error if application is not running:This does not correctly cover the case when signing is done in offline mode. Furthermore, this custom logic is not even needed. The check if the application is running is already correctly done when getting the API client, and that function throws the correct error:
Additional request
Since the concept of a "path" could mean different things, it would be nice to make the invalid key derivation path error message more specific by changing it from
Invalid path format
intoInvalid key derivation path format
.