зеркало из https://github.com/mozilla/fxa.git
fix(subscriptions): throw correct error for unknown subhub customer
fixes #1954
This commit is contained in:
Родитель
26259c6659
Коммит
ec14fc4129
|
@ -188,10 +188,7 @@ module.exports = function(log, config) {
|
|||
} catch (err) {
|
||||
if (err.statusCode === 404) {
|
||||
log.error('subhub.listSubscriptions.1', { uid, err });
|
||||
// TODO: update with subhub listSubscriptions error response for invalid uid
|
||||
if (err.message === 'invalid uid') {
|
||||
throw error.unknownCustomer(uid);
|
||||
}
|
||||
throw error.unknownCustomer(uid);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ describe('subhub client', () => {
|
|||
it('should throw on unknown user', async () => {
|
||||
mockServer
|
||||
.get(`/v1/customer/${UID}/subscriptions`)
|
||||
.reply(404, { message: 'invalid uid' });
|
||||
.reply(404, { message: 'Customer does not exist.' });
|
||||
const { log, subhub } = makeSubject();
|
||||
try {
|
||||
await subhub.listSubscriptions(UID);
|
||||
|
|
Загрузка…
Ссылка в новой задаче