-
Notifications
You must be signed in to change notification settings - Fork 198
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
Changed exception when sending msg to queue without proper url #493
Conversation
def requiredUrlParam(n: String): Directive1[String] = { | ||
p.get(n) match { | ||
case Some(v) => provide(v) | ||
case None => reject(WrongURLFormatRejection(n)) |
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.
hm well if the parameter is absent, then the format isn't wrong, it's missing, no? :)
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.
Yes, changed back to MissingQueryParamRejection
:)
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.
It's still the same?
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.
Yes, resulting exception is still the same.
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 mean, the method requiredUrlParam
gives a WrongURLFormatRejection
which is not very logical
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.
Modified solution, added new directive.
private def checkOnlyQueueNameInUri(): Directive1[String] = { | ||
extractUri.flatMap { | ||
uri => { | ||
val onlyQueueNameInUriPath = Option(uri.path.toString().tail) |
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.
doesn't this always return Some(the uri without the first character)
?
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.
Thanks for advice, now I'm checking if there is only one segment in uri.
No description provided.