twitter4s
twitter4s copied to clipboard
Handle stream errors - change proposal
This is not an error handling:
def filterStatuses(follow: Seq[Long] = Seq.empty,
...
errorHandler: PartialFunction[Throwable, Unit] = ErrorHandler.ignore
...
object ErrorHandler {
def ignore: PartialFunction[Throwable, Unit] = {
case scala.util.control.NonFatal(e) => ()
}
}
make it at least:
object ErrorHandler {
val log: Logger = ...
def ignore: PartialFunction[Throwable, Unit] = {
case scala.util.control.NonFatal(e) => log.warn("Error", e)
}
}
Hi @papirosko, thanks for the suggestion! Yes, I like your proposal: could you send us a PR?
Thanks, Daniela
https://github.com/DanielaSfregola/twitter4s/pull/245