Skip to content

Commit

Permalink
fix: show error toast on Run failure when inputs or credentials are i… (
Browse files Browse the repository at this point in the history
#8391)

* fix: show error toast on Run failure when inputs or credentials are invalid

* Remove supabase folder from tracking

* revert supabase

* remove toast

---------

Co-authored-by: Avhimanyu <2023ebcs396@online.bits-pilani.ac.in>
Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent ff1fa2a commit 5ee909f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions autogpt_platform/frontend/src/hooks/useAgentGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,25 @@ export default function useAgentGraph(
if (saveRunRequest.state === "error") {
if (saveRunRequest.request === "save") {
console.error("Error saving agent");
toast({
variant: "destructive",
title: `Error saving agent`,
duration: 2000,
});
} else if (saveRunRequest.request === "run") {
toast({
variant: "destructive",
title: `Error saving&running agent`,
duration: 2000,
});
console.error(`Error saving&running agent`);
} else if (saveRunRequest.request === "stop") {
console.error(`Error stopping agent`);
toast({
variant: "destructive",
title: `Error stopping agent`,
duration: 2000,
});
}
// Reset request
setSaveRunRequest({
Expand All @@ -443,6 +458,11 @@ export default function useAgentGraph(
} else if (saveRunRequest.request === "run") {
if (!validateNodes()) {
console.error("Validation failed; aborting run");
toast({
title: "Invalid credentials or inputs",
variant: "destructive",
duration: 2000,
});
setSaveRunRequest({
request: "none",
state: "none",
Expand Down

0 comments on commit 5ee909f

Please sign in to comment.