🐛 Emit error instead of throwing it

This commit is contained in:
Androz2091 2020-11-03 21:19:30 +01:00
parent acdfbba287
commit 23ecdf7eee

View file

@ -171,7 +171,7 @@ class Player extends EventEmitter {
}).catch(() => {})
}
if (tracks.length === 0) throw new Error('No tracks found for the specified query.')
if (tracks.length === 0) this.emit('noResults', message, query)
this.emit('searchResults', message, query, tracks)