Merge pull request #394 from mozilla/pb/392-homegeneous-logs
https://github.com/mozilla/fxa-profile-server/pull/394 r=vbudhram
This commit is contained in:
Коммит
42d85cd599
|
@ -41,7 +41,7 @@ exports.upload = function upload(id, payload, headers) {
|
|||
}
|
||||
|
||||
if (res.statusCode >= 400 || (body && body.error) || nestedError) {
|
||||
logger.error('upload.worker.error', body);
|
||||
logger.error('upload.worker.error', nestedError || body);
|
||||
reject(AppError.processingError(body));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -735,12 +735,12 @@ describe('/avatar', function() {
|
|||
user: USERID,
|
||||
scope: ['profile:avatar:write']
|
||||
});
|
||||
mock.workerFailure('post', imageData.length);
|
||||
mock.workerFailure('post', imageData.length, [ { error: 'wibble' } ]);
|
||||
mock.log('img_workers', function(rec) {
|
||||
if (rec.levelname === 'ERROR') {
|
||||
assert.equal(
|
||||
rec.message,
|
||||
'upload.worker.error unexpected server error'
|
||||
'upload.worker.error wibble'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ module.exports = function mock(options) {
|
|||
.reply(200, body);
|
||||
},
|
||||
|
||||
workerFailure: function workerFailure(action, bytes) {
|
||||
workerFailure: function workerFailure(action, bytes, response) {
|
||||
if (action !== 'post' && action !== 'delete') {
|
||||
throw new Error('failure must be post or delete');
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ module.exports = function mock(options) {
|
|||
})
|
||||
.filteringPath(/^\/a\/[0-9a-f]{32}$/g, '/a/' + MOCK_ID)
|
||||
[action]('/a/' + MOCK_ID) // eslint-disable-line no-unexpected-multiline
|
||||
.reply(500, 'unexpected server error');
|
||||
.reply(500, response || 'unexpected server error');
|
||||
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче