mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
fix(core): error message interpolation (#465)
This commit is contained in:
parent
e297dcbb33
commit
f260d2bb56
4 changed files with 4 additions and 3 deletions
|
@ -151,7 +151,7 @@ describe('getConnectorInstanceByType', () => {
|
|||
test('should throw when there is no enabled connector existing in DB', async () => {
|
||||
const type = ConnectorType.SMS;
|
||||
await expect(getConnectorInstanceByType(type)).rejects.toMatchError(
|
||||
new RequestError('connector.not_found', { type })
|
||||
new RequestError({ code: 'connector.not_found', type })
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -87,7 +87,7 @@ export const getConnectorInstanceByType = async <T extends ConnectorInstance>(
|
|||
);
|
||||
|
||||
if (!connector) {
|
||||
throw new RequestError('connector.not_found', { type });
|
||||
throw new RequestError({ code: 'connector.not_found', type });
|
||||
}
|
||||
|
||||
return connector;
|
||||
|
|
|
@ -27,7 +27,7 @@ const getConnector = async (connectorId: string) => {
|
|||
throw new RequestError({
|
||||
code: 'session.invalid_connector_id',
|
||||
status: 422,
|
||||
data: { connectorId },
|
||||
connectorId,
|
||||
});
|
||||
}
|
||||
throw error;
|
||||
|
|
|
@ -35,6 +35,7 @@ jest.mock('@/lib/social', () => ({
|
|||
throw new RequestError({
|
||||
code: 'session.invalid_connector_id',
|
||||
status: 422,
|
||||
connectorId,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue