mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -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 () => {
|
test('should throw when there is no enabled connector existing in DB', async () => {
|
||||||
const type = ConnectorType.SMS;
|
const type = ConnectorType.SMS;
|
||||||
await expect(getConnectorInstanceByType(type)).rejects.toMatchError(
|
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) {
|
if (!connector) {
|
||||||
throw new RequestError('connector.not_found', { type });
|
throw new RequestError({ code: 'connector.not_found', type });
|
||||||
}
|
}
|
||||||
|
|
||||||
return connector;
|
return connector;
|
||||||
|
|
|
@ -27,7 +27,7 @@ const getConnector = async (connectorId: string) => {
|
||||||
throw new RequestError({
|
throw new RequestError({
|
||||||
code: 'session.invalid_connector_id',
|
code: 'session.invalid_connector_id',
|
||||||
status: 422,
|
status: 422,
|
||||||
data: { connectorId },
|
connectorId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
@ -35,6 +35,7 @@ jest.mock('@/lib/social', () => ({
|
||||||
throw new RequestError({
|
throw new RequestError({
|
||||||
code: 'session.invalid_connector_id',
|
code: 'session.invalid_connector_id',
|
||||||
status: 422,
|
status: 422,
|
||||||
|
connectorId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue