fix(agents): show error toast on agent creation failure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cc19cfb15a
commit
9e2cb4040f
1 changed files with 3 additions and 1 deletions
|
|
@ -62,6 +62,7 @@ import {
|
|||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { toast } from "sonner";
|
||||
import { api } from "@/shared/api";
|
||||
import { useAuthStore } from "@/features/auth";
|
||||
import { useWorkspaceStore } from "@/features/workspace";
|
||||
|
|
@ -145,7 +146,8 @@ function CreateAgentDialog({
|
|||
triggers: [{ id: generateId(), type: "on_assign", enabled: true, config: {} }],
|
||||
});
|
||||
onClose();
|
||||
} catch {
|
||||
} catch (err) {
|
||||
toast.error(err instanceof Error ? err.message : "Failed to create agent");
|
||||
setCreating(false);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue