Improve gzip error message
This commit is contained in:
parent
9eeeadbc07
commit
c0ea5be5d3
@ -126,6 +126,7 @@ function handleCopyFrom (logger) {
|
||||
})
|
||||
.pipe(isGzip ? zlib.createGunzip() : new PassThrough())
|
||||
.on('error', err => {
|
||||
err.message = `Error while gunzipping: ${err.message}`
|
||||
metrics.end(null, err);
|
||||
pgstream.emit('error', err);
|
||||
})
|
||||
|
@ -187,7 +187,7 @@ describe('copy-endpoints', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an error when gzip headers are not correct', function(done) {
|
||||
it.only('should return an error when gzip headers are not correct', function(done) {
|
||||
assert.response(server, {
|
||||
url: "/api/v1/sql/copyfrom?" + querystring.stringify({
|
||||
q: "COPY copy_endpoints_test (id, name) FROM STDIN WITH (FORMAT CSV, DELIMITER ',', HEADER true)"
|
||||
@ -203,7 +203,7 @@ describe('copy-endpoints', function() {
|
||||
assert.deepEqual(
|
||||
JSON.parse(res.body),
|
||||
{
|
||||
error:["incorrect header check"]
|
||||
error:["Error while gunzipping: incorrect header check"]
|
||||
}
|
||||
);
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user