Search in sources :

Example 61 with FriendlyException

use of com.sedmelluq.discord.lavaplayer.tools.FriendlyException in project lavaplayer by sedmelluq.

the class DefaultAudioPlayerManager method dispatchItemLoadFailure.

private void dispatchItemLoadFailure(String identifier, AudioLoadResultHandler resultHandler, Throwable throwable) {
    FriendlyException exception = ExceptionTools.wrapUnfriendlyExceptions("Something went wrong when looking up the track", FAULT, throwable);
    ExceptionTools.log(log, exception, "loading item " + identifier);
    resultHandler.loadFailed(exception);
}
Also used : FriendlyException(com.sedmelluq.discord.lavaplayer.tools.FriendlyException)

Example 62 with FriendlyException

use of com.sedmelluq.discord.lavaplayer.tools.FriendlyException in project lavaplayer by sedmelluq.

the class OggAudioTrack method process.

@Override
public void process(final LocalAudioTrackExecutor localExecutor) {
    OggPacketInputStream packetInputStream = new OggPacketInputStream(inputStream, false);
    log.debug("Starting to play an OGG stream track {}", getIdentifier());
    localExecutor.executeProcessingLoop(() -> {
        try {
            processTrackLoop(packetInputStream, localExecutor.getProcessingContext());
        } catch (IOException e) {
            throw new FriendlyException("Stream broke when playing OGG track.", SUSPICIOUS, e);
        }
    }, null, true);
}
Also used : IOException(java.io.IOException) FriendlyException(com.sedmelluq.discord.lavaplayer.tools.FriendlyException)

Aggregations

FriendlyException (com.sedmelluq.discord.lavaplayer.tools.FriendlyException)62 IOException (java.io.IOException)23 AudioTrack (com.sedmelluq.discord.lavaplayer.track.AudioTrack)18 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)13 AudioLoadResultHandler (com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler)12 JsonBrowser (com.sedmelluq.discord.lavaplayer.tools.JsonBrowser)12 AudioPlaylist (com.sedmelluq.discord.lavaplayer.track.AudioPlaylist)12 ArrayList (java.util.ArrayList)10 HttpGet (org.apache.http.client.methods.HttpGet)10 List (java.util.List)7 HttpInterface (com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface)6 BasicAudioPlaylist (com.sedmelluq.discord.lavaplayer.track.BasicAudioPlaylist)5 URI (java.net.URI)4 URISyntaxException (java.net.URISyntaxException)4 MediaContainerHints (com.sedmelluq.discord.lavaplayer.container.MediaContainerHints)3 PersistentHttpStream (com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream)3 AudioReference (com.sedmelluq.discord.lavaplayer.track.AudioReference)3 AudioTrackInfo (com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo)3 Document (org.jsoup.nodes.Document)3 Track (com.arsenarsen.lavaplayerbridge.player.Track)2