mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix: show error toast on Run failure when inputs or credentials are i… (#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>
This commit is contained in:
@@ -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({
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user