trac-peer 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/functions.js +3 -2
- package/src/index.js +2 -2
- package/src/protocol.js +2 -2
package/package.json
CHANGED
package/src/functions.js
CHANGED
|
@@ -308,8 +308,9 @@ export async function tx(input, peer){
|
|
|
308
308
|
}
|
|
309
309
|
res = await peer.protocol_instance.tx(splitted);
|
|
310
310
|
} catch(e){ console.log(e) }
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
const err = peer.protocol_instance.getError(res);
|
|
312
|
+
if(null !== err){
|
|
313
|
+
console.log(err.message);
|
|
313
314
|
}
|
|
314
315
|
peer.protocol_instance.sim = false;
|
|
315
316
|
return res;
|
package/src/index.js
CHANGED
|
@@ -100,7 +100,7 @@ export class Peer extends ReadyResource {
|
|
|
100
100
|
post_tx.value.w, post_tx.value.i, post_tx.value.ipk,
|
|
101
101
|
post_tx.value.ch, post_tx.value.in
|
|
102
102
|
) &&
|
|
103
|
-
null
|
|
103
|
+
null === _this.protocol_instance.getError(await _this.contract_instance.execute(op, batch))) {
|
|
104
104
|
let len = await batch.get('txl');
|
|
105
105
|
if(null === len) {
|
|
106
106
|
len = 0;
|
|
@@ -143,7 +143,7 @@ export class Peer extends ReadyResource {
|
|
|
143
143
|
null === await batch.get('sh/'+op.hash) &&
|
|
144
144
|
b4a.byteLength(str_value) <= 10_2400 &&
|
|
145
145
|
chat_status.value === 'on' &&
|
|
146
|
-
null
|
|
146
|
+
null === _this.protocol_instance.getError(await _this.contract_instance.execute(op, batch))){
|
|
147
147
|
let len = await batch.get('msgl');
|
|
148
148
|
if(null === len) {
|
|
149
149
|
len = 0;
|
package/src/protocol.js
CHANGED
|
@@ -150,8 +150,8 @@ class Protocol{
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
getError(value){
|
|
153
|
-
if (value === false || (value && value.stack && value.message)) {
|
|
154
|
-
return value === false ? 'Generic Error' : value
|
|
153
|
+
if (value === false || (value !== undefined && value.stack !== undefined && value.message != undefined)) {
|
|
154
|
+
return value === false ? new Error('Generic Error') : value;
|
|
155
155
|
}
|
|
156
156
|
return null;
|
|
157
157
|
}
|