Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Check getone type validation #141

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion @worldsibu/convector-core-chaincode/src/chaincode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Chaincode extends CC {
return invokeRes;
} catch (e) {
const err = new ChaincodeInvokationError(e);
console.log('There was an error', err);
console.log('There was an error', e);
return error(Buffer.from(JSON.stringify(new ChaincodeError(err.toString()))));
}
}
Expand Down
4 changes: 2 additions & 2 deletions @worldsibu/convector-core-model/src/convector-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export abstract class ConvectorModel<T extends ConvectorModel<any>> {

const model = new type(content);

if ((content && model) && content.type !== model.type) {
throw new Error(`Possible ID collision, element ${id} of type ${content.type} is not ${model.type}`);
if ((content && model) && content.type !== new type('').type) {
throw new Error(`Possible ID collision, element ${id} of type ${content.type} is not ${new type('').type}`);
}

return model;
Expand Down