-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
=htc replace usage of RuleNotFoundException
by introducing explicit result ADT
#1424
=htc replace usage of RuleNotFoundException
by introducing explicit result ADT
#1424
Conversation
Test FAILed. |
74a8722
to
5170d5f
Compare
Added missing mima filters. |
Test FAILed. |
5170d5f
to
501661e
Compare
Test PASSed. |
@@ -0,0 +1,7 @@ | |||
# Changes to internal API | |||
ProblemFilters.exclude[MissingClassProblem]("akka.http.impl.model.parser.HeaderParser$RuleNotFoundException$") |
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.
Can we ProblemFilters.exclude[Problem]("akka.http.impl.*")
?
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.
I guess we can. It's somewhat interesting to see what has changed in the API but it's mostly distracting so I'll try.
@@ -62,18 +62,21 @@ private[http] class HeaderParser( | |||
|
|||
///////////////// DynamicRuleHandler ////////////// | |||
|
|||
type Result = Either[ErrorInfo, HttpHeader] | |||
type Result = HeaderParser.Result |
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.
I was confused why not just use HeaderParser.Result
directly, but this is specifying the Result
from DeliveryScheme
.
It looks like type
also accepts an override
modifier, might be a nice way to make that explicit?
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.
👍
case NonFatal(e) ⇒ ErrorInfo.fromCompoundString(e.getMessage) | ||
} | ||
} | ||
def ruleNotFound(ruleName: String): Result = HeaderParser.RuleNotFound |
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.
👍 nice!
… result ADT Before every attempt to parse an unknown (i.e. not modeled) header would end up in throwing and catching an exception. This does not really make sense as parboiled already provides for delivering these signals without an exception. Refs playframework/playframework#7822
501661e
to
b181ffa
Compare
Test PASSed. |
Before every attempt to parse an unknown (i.e. not modeled) header would
end up in throwing and catching an exception. This does not really make
sense as parboiled already provides for delivering these signals without
an exception.
Refs playframework/playframework#7822