generated from openmcp-project/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area/mcp-uiAll ManagedControlPlane UI related issuesAll ManagedControlPlane UI related issueskind/taskGeneral task that needs to be done.General task that needs to be done.
Description
Understand the Task
Description
We need to reinforce the fetchApiServer
method in https://github.com/openmcp-project/ui-frontend/blob/00d740e8339d9c5706c64a60b4b22055dc95e6ed/src/lib/api/fetch.ts#L54C5-L59C17.
Currently we optimistically parse to json. As sometimes the API server could answer with just text (plain/text
) we should check the Content-Type before we parse the body.
We also need to proper handle occurring errors in that spot. So a well written try/catch is needed.
Any further valuable resources.
- MCPs without flux installed,
- answer on the flux endpoints with text
404 page not found
.
Preferred: lets use defensive try-catch block for JSON and use text alternatively
Optional: The Content-Type header in the response is: content-type: text/plain; charset=utf-8
What is required to accept the Task as done.
Done Criteria
- Catch possible errors, when parsing and handle them
- Check Content-Type before we parse it.
- parse Content accordingly (application/json, text/plain, ....)
- in the component where error is shown we no longer see JSon parsing issues
Metadata
Metadata
Assignees
Labels
area/mcp-uiAll ManagedControlPlane UI related issuesAll ManagedControlPlane UI related issueskind/taskGeneral task that needs to be done.General task that needs to be done.