-
Notifications
You must be signed in to change notification settings - Fork 99
add custom error handler #213
add custom error handler #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR also needs some tests.
response.entity.withoutSizeLimit.dataBytes | ||
.via(Framing.delimiter(ByteString("\r\n"), Int.MaxValue).async) | ||
.filter(_.nonEmpty) | ||
.via(killSwitch.flow) | ||
.map(data => unmarshalStream(data, f)) | ||
.recoverWithRetries(attempts = 3, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, the number of attempts should be configurable.
package com.danielasfregola.twitter4s.http.clients.streaming | ||
|
||
object ErrorHandler { | ||
def default: PartialFunction[Throwable, Unit] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, could you change it to ignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zolrag13,
thanks for your contribution!
LGTM
Codecov Report
@@ Coverage Diff @@
## master #213 +/- ##
==========================================
+ Coverage 94.22% 94.23% +0.01%
==========================================
Files 72 73 +1
Lines 1143 1145 +2
Branches 12 13 +1
==========================================
+ Hits 1077 1079 +2
Misses 66 66
Continue to review full report at Codecov.
|
part of #144