Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
radames/ai-town
hackathonM
/
Matou-Garou
like
6
Sleeping
App
Files
Files
Community
dd84d99
Matou-Garou
/
src
/
toasts.ts
Jofthomas
HF staff
bulk
ce8b18b
7 months ago
raw
Copy download link
history
blame
Safe
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;
}
}