Skip to content

Commit

Permalink
logging: fix error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsPi3141 committed Jul 1, 2024
1 parent 768c464 commit 5231d72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,11 @@ export default function Home() {
const file = e.dataTransfer.files.item(0);
if (!["image/png", "image/jpeg", "image/gif"].includes(file.type)) {
printErr(`Expected image/png, image/jpeg, or image/gif. Got ${file.type}`);
throw printErr("Invalid image file");
throw printErr("Invalid file type");
}
const ab = await file.arrayBuffer();
if (getMimeTypeFromArrayBuffer(ab) == null) {
throw printErr("Invalid image type");
throw printErr("Invalid image file");
}
const reader = new FileReader();
reader.readAsDataURL(new Blob([ab]));
Expand Down

0 comments on commit 5231d72

Please sign in to comment.