Skip to content

Commit

Permalink
chore: improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Dec 6, 2024
1 parent 4f34f2d commit 9ecf610
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/dialog/DialogDisplayPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ const chooseCustomBackground = async (reset?: boolean) => {
if (isImage(workingTempFilepath)) {
setMediaBackground(workingTempFilepath);
} else {
throw new Error('Invalid file type: ' + workingTempFilepath);
throw new Error(
'Invalid file type: ' + workingTempFilepath.split('/').pop(),
);
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/helpers/jw-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export const fetchMedia = async () => {
})
.catch((error) => {
day.error = true;
throw new Error(error);
throw error;
});
} catch (error) {
errorCatcher(error);
Expand Down Expand Up @@ -1642,7 +1642,12 @@ export const getMwMedia = async (lookupDate: Date) => {

if (docId < 0)
throw new Error(
'No document id found for ' + monday + ' ' + issueString + ' ' + db,
'No document id found for ' +
formatDate(monday, 'YYYYMMDD') +
' ' +
issueString +
' ' +
db.split('/').pop(),
);

const mms = getDocumentMultimediaItems(
Expand Down

0 comments on commit 9ecf610

Please sign in to comment.