- Add test/integration.test.ts: getServicePublicKey, full flow (register, login, createCollection, createPointFeature, listFeatures) - Update docs example: registerBySigningServiceKey then loginWithSignature - Document integration tests in typescript-frontend-integration.md Made-with: Cursor
This commit is contained in:
@@ -52,8 +52,9 @@ export class GeoApiClient {
|
||||
const body = init.body === undefined ? undefined : JSON.stringify(init.body);
|
||||
const res = await fetch(`${this.baseUrl}${path}`, { ...init, headers, body });
|
||||
if (!res.ok) {
|
||||
const maybeJson = await res.json().catch(() => ({}));
|
||||
const msg = (maybeJson as { error?: string }).error ?? `HTTP ${res.status}`;
|
||||
const maybeJson = (await res.json().catch(() => ({}))) as { error?: string; hint?: string; code?: string };
|
||||
let msg = maybeJson.error ?? `HTTP ${res.status}`;
|
||||
if (maybeJson.hint) msg += `. ${maybeJson.hint}`;
|
||||
throw new Error(msg);
|
||||
}
|
||||
if (res.status === 204) {
|
||||
|
||||
Reference in New Issue
Block a user