Skip to content

Commit

Permalink
Catch and log any errors we encounter when parsing a URL to display i…
Browse files Browse the repository at this point in the history
…ts hostname
  • Loading branch information
andybalaam committed Jan 14, 2025
1 parent 7f8a733 commit 6fc0fe7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/views/native/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ export default {
components: { DialogImportBookmarks, FaviconImage, DialogEditBookmark, DialogEditFolder, Drawer },
filters: {
hostname(url) {
return new URL(url).hostname
try {
return new URL(url).hostname
} catch (e) {
console.error(`${e}: ${url}`)
return '(bad url)'
}
}
},
data() {
Expand Down

0 comments on commit 6fc0fe7

Please sign in to comment.