mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
feat: Improve error msg when attempting to redeem the same activation code multiple times (no-changelog) (#7355)
This commit is contained in:
committed by
GitHub
parent
cd12a5990a
commit
f4d8c9eed5
@@ -90,7 +90,11 @@ licenseController.post(
|
|||||||
case 'RESERVATION_CONFLICT':
|
case 'RESERVATION_CONFLICT':
|
||||||
message = 'Activation key not found';
|
message = 'Activation key not found';
|
||||||
break;
|
break;
|
||||||
|
case 'RESERVATION_DUPLICATE':
|
||||||
|
message = 'Activation key has already been used on this instance';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
|
message += `: ${error.message}`;
|
||||||
getLogger().error(message, { stack: error.stack ?? 'n/a' });
|
getLogger().error(message, { stack: error.stack ?? 'n/a' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ describe('POST /license/activate', () => {
|
|||||||
|
|
||||||
test('errors out properly', async () => {
|
test('errors out properly', async () => {
|
||||||
License.prototype.activate = jest.fn().mockImplementation(() => {
|
License.prototype.activate = jest.fn().mockImplementation(() => {
|
||||||
throw new Error(ACTIVATION_FAILED_MESSAGE);
|
throw new Error('some fake error');
|
||||||
});
|
});
|
||||||
|
|
||||||
await authOwnerAgent
|
await authOwnerAgent
|
||||||
.post('/license/activate')
|
.post('/license/activate')
|
||||||
.send({ activationKey: 'abcde' })
|
.send({ activationKey: 'abcde' })
|
||||||
.expect(400, { code: 400, message: ACTIVATION_FAILED_MESSAGE });
|
.expect(400, { code: 400, message: `${ACTIVATION_FAILED_MESSAGE}: some fake error` });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user