mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Cleanly handle missing stream error on COPY operation. Closes #241
This commit is contained in:
parent
21c31f69e6
commit
de9d5e3cd5
@ -170,9 +170,11 @@ p.prepare = function(connection) {
|
||||
this.getRows(connection);
|
||||
};
|
||||
p.streamData = function (connection) {
|
||||
this.stream.startStreamingToConnection(connection);
|
||||
if ( this.stream ) this.stream.startStreamingToConnection(connection);
|
||||
else this.handleError(new Error('No destination stream defined'));
|
||||
};
|
||||
p.handleCopyFromChunk = function (chunk) {
|
||||
this.stream.handleChunk(chunk);
|
||||
if ( this.stream ) this.stream.handleChunk(chunk);
|
||||
else this.handleError(new Error('error', 'No source stream defined'));
|
||||
}
|
||||
module.exports = Query;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user