Introduce typed API responses and align workflow outputs
This commit is contained in:
@@ -22,7 +22,7 @@ async function request(path, { method = "GET", body } = {}) {
|
||||
let msg = `${res.status}`;
|
||||
try {
|
||||
const data = await res.json();
|
||||
msg = data.error || JSON.stringify(data);
|
||||
msg = data.error || data.detail || data.title || JSON.stringify(data);
|
||||
} catch { /* ignore */ }
|
||||
const err = new Error(msg);
|
||||
err.status = res.status;
|
||||
|
||||
Reference in New Issue
Block a user