diff --git a/src/api/viguno/client.spec.ts b/src/api/viguno/client.spec.ts index 9f31bb5..378de5d 100644 --- a/src/api/viguno/client.spec.ts +++ b/src/api/viguno/client.spec.ts @@ -188,7 +188,8 @@ describe.concurrent('Viguno Client', () => { it('handles server error when resolving HPO term by ID', async () => { // arrange: - const errorMessage = 'Internal Server Error' + // const errorMessage = 'Internal Server Error' + const errorMessage = 'HPO term not found' fetchMocker.mockResponseOnce(JSON.stringify({ msg: errorMessage }), { status: 500 }) // act: diff --git a/src/api/viguno/client.ts b/src/api/viguno/client.ts index 2418bc2..81a510a 100644 --- a/src/api/viguno/client.ts +++ b/src/api/viguno/client.ts @@ -96,8 +96,12 @@ export class VigunoClient { }) if (!response.ok) { - const errorBody = await response.json() - throw new StatusCodeNotOk(errorBody.msg || response.statusText) + // TODO viguno does not responde with a json body on 500 so we don't have a message. + // TODO once this is fixed in viguno, we can use the code below. + // TODO https://github.com/varfish-org/viguno/issues/186 + // const errorBody = await response.json() + // throw new StatusCodeNotOk(errorBody.msg || response.statusText) + throw new StatusCodeNotOk('HPO term not found') } try {