Skip to content

Commit 4fbbb0b

Browse files
committed
simulation failed message render
1 parent 5ebaaa1 commit 4fbbb0b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/grill/src/providers/grill-provider.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,27 @@ export const GrillProvider: FC<GrillProviderProps> = ({
207207
toastIds.current.delete(txId);
208208
break;
209209
}
210+
case "error-simulation-failed": {
211+
console.error("Simulation failed", event);
212+
const description = `Simulation failed: ${event.errorMessage}`;
213+
if (existingToastId) {
214+
// Update existing toast to error
215+
toast.error(event.title, {
216+
id: existingToastId,
217+
description,
218+
duration: errorToastDuration,
219+
});
220+
} else {
221+
// Create new error toast if somehow we don't have one
222+
toast.error(event.title, {
223+
description,
224+
duration: errorToastDuration,
225+
});
226+
}
227+
// Clean up toast ID after error
228+
toastIds.current.delete(txId);
229+
break;
230+
}
210231
}
211232
},
212233
[

0 commit comments

Comments
 (0)