feat: correlate server errors and monitor application health
This commit is contained in:
@@ -20,7 +20,7 @@ export async function habitRequest<T>(
|
||||
throw new Error("Your session has expired. Sign in again to continue.");
|
||||
const body = await response.json().catch(() => null);
|
||||
throw new Error(
|
||||
body?.error || "Could not reach your workspace. Please try again.",
|
||||
(body?.error || "Could not reach your workspace. Please try again.") + (response.status >= 500 && body?.requestId ? ` Reference: ${body.requestId}` : ""),
|
||||
);
|
||||
}
|
||||
return response.status === 204
|
||||
|
||||
Reference in New Issue
Block a user