mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +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[]>}
 | 
					   * @returns {Promise<Object[]>}
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  async getCustomProviderResults(title, author, isbn, providerSlug) {
 | 
					  async getCustomProviderResults(title, author, isbn, providerSlug) {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
      const books = await this.customProviderAdapter.search(title, author, isbn, providerSlug, 'book', this.#providerResponseTimeout)
 | 
					      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}`)
 | 
					      if (this.verbose) Logger.debug(`Custom provider '${providerSlug}' Search Results: ${books.length || 0}`)
 | 
				
			||||||
 | 
					 | 
				
			||||||
      return books
 | 
					      return books
 | 
				
			||||||
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					      Logger.error(`Error searching Custom provider '${providerSlug}':`, error)
 | 
				
			||||||
 | 
					      return []
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  static TitleCandidates = class {
 | 
					  static TitleCandidates = class {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user