forked from mtusi2026/mtusi2026lab7
Prepare verified laboratory 7 implementation and evidence
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export function parseOpenObserveResponse(status: number, body: string) {
|
||||
let data: unknown;
|
||||
try {
|
||||
data = body.length ? JSON.parse(body) : null;
|
||||
} catch {
|
||||
if (status >= 400) return { status, data: null };
|
||||
throw new Error(`OPENOBSERVE_HTTP_${status}_INVALID_JSON`);
|
||||
}
|
||||
return { status, data };
|
||||
}
|
||||
Reference in New Issue
Block a user