You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
When an Error occurs inside of the chaincode (i.e.: making a throw new Error(...)) the returning message is not parsed as an Error object, therefore errors are going missing. It's returning null right now.
Environment
Convector version (or git revision) that exhibits the issue: 1.2.0
Last Convector version that did not exhibit the issue (if applicable):
OS/version: MAC Mojave 10.14
Node.js version: v8.12.0
Npm or Yarn package manager: 6.4.1
Convector CLI version (if applicable): 1.0.6
Hurley CLI version (if applicable):
Details
Unexpected way of handling errors, looks like Fabric changed something from 1.1 to 1.3-1.4.
Current Behavior
It returns null instead of an Error object.
Expected Behavior
Throw the original Error.
Code To Reproduce Issue [ Good To Have ]
Inside a controller
throw new Error(`Ups, the requesting identity is not authorized to update the model`);
In a unit test just call it with a try catch and the error won't be found, but the response will be null.
try {
let rs = await mybuggychaincodeCtrl.update(modelSample);
// returns null
console.log(rs);
await expect.fail('Should have failed');
} catch (ex) {
// should fall in here
console.log(ex);
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The problem
When an
Error
occurs inside of the chaincode (i.e.: making athrow new Error(...)
) the returning message is not parsed as an Error object, therefore errors are going missing. It's returningnull
right now.Environment
Details
Unexpected way of handling errors, looks like Fabric changed something from 1.1 to 1.3-1.4.
Current Behavior
It returns null instead of an Error object.
Expected Behavior
Throw the original
Error
.Code To Reproduce Issue [ Good To Have ]
Inside a controller
In a unit test just call it with a
try catch
and the error won't be found, but the response will be null.The text was updated successfully, but these errors were encountered: