Allow retrying failed tag sync
This commit is contained in:
parent
3b22fe98f2
commit
199a44a8a7
3 changed files with 15 additions and 11 deletions
|
@ -66,13 +66,10 @@ async function loadCollection(inputUsername) {
|
|||
})
|
||||
} catch (cause) {
|
||||
throw new class extends Error {
|
||||
constructor() {
|
||||
super("Unsupported album/track data", {cause})
|
||||
this.name = "Collection Import Error"
|
||||
this.account = account
|
||||
this.item = item
|
||||
}
|
||||
}
|
||||
name = "Item Import Error"
|
||||
item = item
|
||||
cause = cause
|
||||
}("Unsupported album/track data")
|
||||
}
|
||||
}
|
||||
})()
|
||||
|
@ -112,7 +109,12 @@ router.post("/api/load-collection", defineEventHandler(async event => {
|
|||
const result = await loadCollection(account)
|
||||
setCookie(event, "accounts", (getCookie(event, "accounts") || "").split("|").concat(account).join("|"))
|
||||
return pugSync.render(event, "collection-loaded.pug", result)
|
||||
} catch (error) {
|
||||
} catch (cause) {
|
||||
const error = new class extends Error {
|
||||
name = "Collection Import Error"
|
||||
account = account
|
||||
cause = cause
|
||||
}("Details logged to console. Please ask Cadence to fix it!")
|
||||
console.error(error)
|
||||
return pugSync.render(event, "collection-loaded.pug", {error})
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class TagDownloader extends sync.reloadClassMethods(() => TagDownloader) {
|
|||
}
|
||||
this.outcome = "Success"
|
||||
} catch (e) {
|
||||
console.error(`error downloading tags for ${this.account} - ${e}`)
|
||||
console.error(`error downloading tags for ${this.account} -`, e)
|
||||
this.outcome = e.toString()
|
||||
} finally {
|
||||
this.running = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue