Fix error handling in search

This commit is contained in:
2023-05-30 23:35:18 +02:00
parent 7ff314c8fe
commit b2a5d42cdb
3 changed files with 10 additions and 7 deletions

View File

@@ -39,9 +39,9 @@ const search = async (limit = 10) => {
try {
search_results = await fs_search(state.base.path, search_term, limit)
} catch (err) {
try {
error = JSON.parse(err).value
} catch {
if (err.value) {
error = err.value
} else {
alert(err)
console.error(err)
}