MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / setWriteError

Method setWriteError

lib/writers.js:294–309  ·  view source on GitHub ↗

* Emits the 'error' event and callbacks items that haven't been written and clears them from the queue. * @param err

(err)

Source from the content-addressed store, hash-verified

292 * @param err
293 */
294 setWriteError(err) {
295 err.isSocketError = true;
296 this.error = new types.DriverError('Socket was closed');
297 this.error.isSocketError = true;
298 // Use an special flag for items that haven't been written
299 this.error.requestNotWritten = true;
300 this.error.innerError = err;
301 const q = this.queue;
302 // Not more items can be added to the queue.
303 this.queue = utils.emptyArray;
304 for (let i = 0; i < q.length; i++) {
305 const item = q[i];
306 // Use the error marking that it was not written
307 item.callback(this.error);
308 }
309 }
310}
311
312module.exports = { FrameWriter, WriteQueue };

Callers 1

processMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected