+
+
{data.config}
-
-
-
- {tooltipText}
-
-
+
+
+
+
+
+ {tooltipText}
+
+
-
\ No newline at end of file
+
diff --git a/src/routes/clients/[id]/+page.ts b/src/routes/clients/[id]/+page.ts
index 8a3b993..bd27d3b 100644
--- a/src/routes/clients/[id]/+page.ts
+++ b/src/routes/clients/[id]/+page.ts
@@ -1,10 +1,15 @@
import type { PageLoad } from './$types';
import type { ClientDetails } from '$lib/types/clients';
import { clientDetailsToConfig } from '$lib/clients';
+import { error } from '@sveltejs/kit';
export const load: PageLoad = async ({ fetch, params }) => {
const res = await fetch(`/api/clients/${params.id}`);
- const client = (await res.json()) as ClientDetails;
+ const resJson = await res.json();
+ if (!res.ok) {
+ return error(res.status, resJson['message']);
+ }
+ const client = resJson as ClientDetails;
const config = clientDetailsToConfig(client);
return { client, config };
diff --git a/src/routes/connections/+page.svelte b/src/routes/connections/+page.svelte
index 567e317..8873f85 100644
--- a/src/routes/connections/+page.svelte
+++ b/src/routes/connections/+page.svelte
@@ -33,22 +33,24 @@