Use fmt.Errorf instead of errors.New & new invalid session id error message

This commit is contained in:
bytedream 2022-05-13 19:53:16 +02:00
parent f046b68371
commit 192a85afb8
2 changed files with 5 additions and 7 deletions

View file

@ -2,7 +2,6 @@ package crunchyroll
import (
"encoding/json"
"errors"
"fmt"
"github.com/grafov/m3u8"
"regexp"
@ -83,7 +82,7 @@ func fromVideoStreams(crunchy *Crunchyroll, endpoint string) (streams []*Stream,
if len(jsonBody) == 0 {
// this may get thrown when the crunchyroll account has just a normal account and not one with premium
return nil, errors.New("no stream available")
return nil, fmt.Errorf("no stream available")
}
audioLocale := jsonBody["audio_locale"].(string)