Matou-Garou / src /toasts.ts
Jofthomas's picture
Jofthomas HF staff
bulk
ce8b18b
raw
history blame
228 Bytes
import { toast } from 'react-toastify';
export async function toastOnError<T>(promise: Promise<T>): Promise<T> {
try {
return await promise;
} catch (error: any) {
toast.error(error.message);
throw error;
}
}