When saving a new appspec, the UI throws the following error:
# 404 error resulting from existence check
> GET https://kubernetes.docker.internal/api/v1/services/yay 404
sendRequest @ request.ts:131
await in sendRequest (async)
# I thought that this "uncaught" error would just return undefined.. apparently that is not the case
> Uncaught (in promise) Error: Not found - spec key not found
at catchErrors (request.ts:175:1)
at request (request.ts:203:1)
at async AppSpecService.getServiceById (AppSpecService.ts:96:1)
at async saveSpec (AddEditSpec.tsx:329:1)
catchErrors @ request.ts:175
request @ request.ts:203
await in request (async)
onClick @ AddEditSpec.tsx:375
# This only appears in development mode, but "process" is usually a server-side thing...
> Uncaught ReferenceError: process is not defined
Apparently we need a .catch clause when async/await will hit an error
Approach
Remove async/await here, switch back to using a classic Promise
Add a proper error handler
How to Test
Prerequisites:
workbench-helm-chart checked out locally
cd src/webui/
User added to workbench-developers group in Keycloak
Test Steps:
Checkout this branch and run locally: make compile
Login to Workbench WebUI via Keycloak user
Navigate to My Catalog
Click the "Create New Application" button
Enter spec details:
key: anything
image: something
ports: 8888
Click Save
You should be redirected back to the My Catalog view
You should see your new application now appears in the list
Problem
When saving a new appspec, the UI throws the following error:
Apparently we need a
.catch
clause when async/await will hit an errorApproach
How to Test
Prerequisites:
workbench-helm-chart
checked out locallycd src/webui/
workbench-developers
group in KeycloakTest Steps:
make compile
anything
something