chore: update error message (#129)

This commit is contained in:
boojack 2022-07-24 00:29:19 +08:00 committed by GitHub
parent 7e34de23f1
commit 38383a426f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,16 +107,16 @@ const MemoEditor: React.FC<Props> = () => {
const { type } = file;
if (!type.startsWith("image")) {
toastHelper.error("Only image file supported.");
return;
}
try {
const image = await resourceService.upload(file);
const url = `/h/r/${image.id}/${image.filename}`;
return url;
} catch (error: any) {
toastHelper.error(error);
toastHelper.error("Failed to upload image\n" + JSON.stringify(error, null, 4));
} finally {
setState({
...state,