mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:56:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
6749ab0340
commit
f0e85697a6
1 changed files with 6 additions and 1 deletions
|
|
@ -24,10 +24,15 @@ export async function railwayQuery<T>(
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const text = await res.text();
|
const text = await res.text();
|
||||||
|
console.error(`Railway HTTP ${res.status} for query:`, query.trim().split("\n")[1]?.trim(), "vars:", JSON.stringify(variables), "body:", text);
|
||||||
throw new Error(`Railway HTTP ${res.status}: ${text}`);
|
throw new Error(`Railway HTTP ${res.status}: ${text}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.json();
|
const json = await res.json();
|
||||||
|
if (json.errors?.length) {
|
||||||
|
console.error("Railway GraphQL errors:", JSON.stringify(json.errors), "for vars:", JSON.stringify(variables));
|
||||||
|
}
|
||||||
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createRailwayService(opts: {
|
export async function createRailwayService(opts: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue