From d1da9f2f027de6c5f23bff69e28cc87c19cf7d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferreira=20Batista?= Date: Wed, 20 Aug 2025 10:34:42 +0200 Subject: [PATCH] Fixes error message presented in the settins scheduling frontend (#1035) When you submit an incorrect cron (for example ``0 5``) the frontend doesn't surface the error message that the API returns, but only the default generic one. This fix makes it surface when the api returns the message in the error attribute and not in the message attribute. --- frontend/src/functions/APIClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/functions/APIClient.ts b/frontend/src/functions/APIClient.ts index 5b464f3d..02a8d1d2 100644 --- a/frontend/src/functions/APIClient.ts +++ b/frontend/src/functions/APIClient.ts @@ -49,7 +49,7 @@ const APIClient = async ( const data = await response.json(); throw { status: response.status, - message: data?.message || 'An error occurred while processing the request.', + message: data?.message || data?.error || 'An error occurred while processing the request.', } as ApiError; }