Skip to content

Commit 479c92c

Browse files
authored
Suppress 500 errors during RSS fetching (#166)
1 parent 6cad865 commit 479c92c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/scala/plex/PlexUtils.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory
1111
import io.circe.generic.extras
1212
import io.circe.generic.extras.auto._
1313
import io.circe.syntax.EncoderOps
14+
import org.http4s.client.UnexpectedStatus
1415

1516
trait PlexUtils {
1617

@@ -23,13 +24,16 @@ trait PlexUtils {
2324
val jsonFormatUrl = url.withQueryParam("format", "json")
2425

2526
client.httpRequest(Method.GET, jsonFormatUrl).map {
27+
case Left(UnexpectedStatus(s, _, _)) if s.code == 500 =>
28+
logger.debug(s"Unable to fetch watchlist from Plex, see https://github.com/nylonee/watchlistarr/issues/161")
29+
Set.empty
2630
case Left(err) =>
2731
logger.warn(s"Unable to fetch watchlist from Plex: $err")
2832
Set.empty
2933
case Right(json) =>
3034
logger.debug("Found Json from Plex watchlist, attempting to decode")
3135
json.as[Watchlist].map(_.items).getOrElse {
32-
logger.warn("Unable to fetch watchlist from Plex - decoding failure. Returning empty list instead")
36+
logger.warn("Unable to fetch watchlist from Plex - decoding failure")
3337
Set.empty
3438
}
3539
}

0 commit comments

Comments
 (0)