fix error display for new api schema

This commit is contained in:
anovazzi1 2024-04-19 08:59:32 -03:00
commit 1a24fe7e99
3 changed files with 10 additions and 11 deletions

View file

@ -5686,9 +5686,9 @@
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.4.742", "version": "1.4.744",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.742.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.744.tgz",
"integrity": "sha512-EhE+z1d5RNytAq/qnGAxPR+ie3UzKbv7qqQc0wnEbOh+KDUplgfzkGSCy9d78B+S+nVNTS42BabHXB6Ni+Ud4w==" "integrity": "sha512-nAGcF0yeKKfrP13LMFr5U1eghfFSvFLg302VUFzWlcjPOnUYd52yU5x6PBYrujhNbc4jYmZFrGZFK+xasaEzVA=="
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "9.2.2", "version": "9.2.2",
@ -13216,9 +13216,9 @@
} }
}, },
"node_modules/zod": { "node_modules/zod": {
"version": "3.22.4", "version": "3.22.5",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.5.tgz",
"integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "integrity": "sha512-HqnGsCdVZ2xc0qWPLdO25WnseXThh0kEYKIdV5F/hTHO75hNZFp8thxSeHhiPrHZKrFTo1SOgkAj9po5bexZlw==",
"funding": { "funding": {
"url": "https://github.com/sponsors/colinhacks" "url": "https://github.com/sponsors/colinhacks"
} }

View file

@ -150,10 +150,8 @@ export type VertexBuildTypeAPI = {
inactivated_vertices: Array<string> | null; inactivated_vertices: Array<string> | null;
next_vertices_ids: Array<string>; next_vertices_ids: Array<string>;
top_level_vertices: Array<string>; top_level_vertices: Array<string>;
run_id: string; run_id?: string;
valid: boolean; valid: boolean;
logs: Log[];
messages: ChatOutputType[] | chatInputType[];
data: VertexDataTypeAPI; data: VertexDataTypeAPI;
timestamp: string; timestamp: string;
}; };
@ -162,7 +160,7 @@ export type VertexBuildTypeAPI = {
// it has results, artifacts, timedelta, duration // it has results, artifacts, timedelta, duration
export type VertexDataTypeAPI = { export type VertexDataTypeAPI = {
results: { [key: string]: { [key: string]: string } }; results: { [key: string]: { [key: string]: string } };
artifacts: { [key: string]: string }; logs:{message:string}[];
messages: ChatOutputType[] | chatInputType[]; messages: ChatOutputType[] | chatInputType[];
timedelta?: number; timedelta?: number;
duration?: string; duration?: string;

View file

@ -243,7 +243,7 @@ async function buildVertex({
if (!buildData.valid) { if (!buildData.valid) {
onBuildError!( onBuildError!(
"Error Building Component", "Error Building Component",
[buildData.params], buildData.data.logs.map((log) => log.message),
verticesIds.map((id) => ({ id })) verticesIds.map((id) => ({ id }))
); );
stopBuild(); stopBuild();
@ -252,6 +252,7 @@ async function buildVertex({
} }
buildResults.push(buildData.valid); buildResults.push(buildData.valid);
} catch (error) { } catch (error) {
console.error(error);
onBuildError!( onBuildError!(
"Error Building Component", "Error Building Component",
[(error as AxiosError<any>).response?.data?.detail ?? "Unknown Error"], [(error as AxiosError<any>).response?.data?.detail ?? "Unknown Error"],