Jofthomas's picture
Jofthomas HF staff
bulk2
90cbf22
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;
}
}