mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Merge pull request #3396 from mikiher/custom-provider-try-catch
Add a try-catch block around custom provider search
This commit is contained in:
commit
7a0cd1eb34
@ -202,10 +202,14 @@ class BookFinder {
|
||||
* @returns {Promise<Object[]>}
|
||||
*/
|
||||
async getCustomProviderResults(title, author, isbn, providerSlug) {
|
||||
const books = await this.customProviderAdapter.search(title, author, isbn, providerSlug, 'book', this.#providerResponseTimeout)
|
||||
if (this.verbose) Logger.debug(`Custom provider '${providerSlug}' Search Results: ${books.length || 0}`)
|
||||
|
||||
return books
|
||||
try {
|
||||
const books = await this.customProviderAdapter.search(title, author, isbn, providerSlug, 'book', this.#providerResponseTimeout)
|
||||
if (this.verbose) Logger.debug(`Custom provider '${providerSlug}' Search Results: ${books.length || 0}`)
|
||||
return books
|
||||
} catch (error) {
|
||||
Logger.error(`Error searching Custom provider '${providerSlug}':`, error)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
static TitleCandidates = class {
|
||||
|
Loading…
Reference in New Issue
Block a user