Compare commits

...

1 Commits

Author SHA1 Message Date
Dora Korpar 60d9a4957a Change err to err message 2017-07-12 13:56:43 -07:00
1 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@ class AwsClient {
if (err) { if (err) {
const log = createLogger(reqUids); const log = createLogger(reqUids);
log.error('err from data backend', log.error('err from data backend',
{ error: err, dataStoreName: this._dataStoreName }); { error: err.message, dataStoreName: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
return callback(null, awsKey); return callback(null, awsKey);
@ -60,7 +60,7 @@ class AwsClient {
{ responseHeaders: response.httpResponse.headers }); { responseHeaders: response.httpResponse.headers });
}); });
const stream = request.createReadStream().on('error', err => { const stream = request.createReadStream().on('error', err => {
log.error('error streaming data from AWS', { error: err, log.error('error streaming data from AWS', { error: err.message,
dataStoreName: this._dataStoreName }); dataStoreName: this._dataStoreName });
}); });
return callback(null, stream); return callback(null, stream);
@ -77,7 +77,7 @@ class AwsClient {
if (err) { if (err) {
const log = createLogger(reqUids); const log = createLogger(reqUids);
log.error('error deleting object from datastore', log.error('error deleting object from datastore',
{ error: err, implName: this._clientType }); { error: err.message, implName: this._clientType });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
return callback(); return callback();
@ -95,7 +95,7 @@ class AwsClient {
Bucket: this._awsBucketName }, Bucket: this._awsBucketName },
(err, data) => { (err, data) => {
if (err) { if (err) {
multBackendResp[location] = { error: err }; multBackendResp[location] = { error: err.message };
} else if (!data.Status || } else if (!data.Status ||
data.Status === 'Suspended') { data.Status === 'Suspended') {
multBackendResp[location] = { multBackendResp[location] = {
@ -122,7 +122,7 @@ class AwsClient {
return this._client.createMultipartUpload(params, (err, mpuResObj) => { return this._client.createMultipartUpload(params, (err, mpuResObj) => {
if (err) { if (err) {
log.error('err from data backend', log.error('err from data backend',
{ error: err, dataStore: this._dataStoreName }); { error: err.message, dataStore: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
return callback(null, mpuResObj); return callback(null, mpuResObj);
@ -143,7 +143,7 @@ class AwsClient {
return this._client.uploadPart(params, (err, partResObj) => { return this._client.uploadPart(params, (err, partResObj) => {
if (err) { if (err) {
log.error('err from data backend on uploadPart', log.error('err from data backend on uploadPart',
{ error: err, dataStoreName: this._dataStoreName }); { error: err.message, dataStoreName: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
// Because we manually add quotes to ETag later, remove quotes here // Because we manually add quotes to ETag later, remove quotes here
@ -184,12 +184,12 @@ class AwsClient {
if (err) { if (err) {
if (mpuError[err.code]) { if (mpuError[err.code]) {
log.trace('err from data backend on completeMPU', log.trace('err from data backend on completeMPU',
{ error: err, { error: err.message,
dataStoreName: this._dataStoreName }); dataStoreName: this._dataStoreName });
return callback(errors[err.code]); return callback(errors[err.code]);
} }
log.error('err from data backend on completeMPU', log.error('err from data backend on completeMPU',
{ error: err, dataStoreName: this._dataStoreName }); { error: err.message, dataStoreName: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
// need to get content length of new object to store // need to get content length of new object to store
@ -198,7 +198,7 @@ class AwsClient {
(err, objHeaders) => { (err, objHeaders) => {
if (err) { if (err) {
log.trace('err from data backend on headObject', log.trace('err from data backend on headObject',
{ error: err, { error: err.message,
dataStoreName: this._dataStoreName }); dataStoreName: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
@ -219,7 +219,7 @@ class AwsClient {
if (err) { if (err) {
log.error('There was an error aborting the MPU on AWS S3. You' + log.error('There was an error aborting the MPU on AWS S3. You' +
' should abort directly on AWS S3 using the same uploadId.', ' should abort directly on AWS S3 using the same uploadId.',
{ error: err, dataStoreName: this._dataStoreName }); { error: err.message, dataStoreName: this._dataStoreName });
return callback(errors.InternalError); return callback(errors.InternalError);
} }
return callback(); return callback();