chore: update error message (#129)

pull/132/head
boojack 3 years ago committed by GitHub
parent 7e34de23f1
commit 38383a426f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save