We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adefa7b commit 69627a1Copy full SHA for 69627a1
lib/postgres/index.js
@@ -172,7 +172,8 @@ module.exports = async(
172
txMap.set(id, client);
173
return id;
174
} catch (e) {
175
- log('error', `TX Begin: id: ${id}`, e);
+ log('error', `fail while TX Begin: id: ${id}`);
176
+ log('error', e);
177
throw e;
178
}
179
},
@@ -185,11 +186,13 @@ module.exports = async(
185
186
async txEnd(id, action) {
187
try {
188
const client = txMap.get(id);
189
+ if (!client) {throw new Error('NoSuchTxId');}
190
await client.query(action);
191
client.release();
192
txMap.delete(id);
193
- log('error', `TX End: id: ${id}`, e);
194
+ log('error', `fail while try to end tx id ${id}`);
195
196
197
198
0 commit comments