Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Gavin Bisesi
@Daenyth
Nonzero exit code returned from runner: 1
will happen if your ..yield response for fails
Drew Boardman
@drewboardman
well MyError extends Exception
Gavin Bisesi
@Daenyth
right
Drew Boardman
@drewboardman
i guess this is the desired behavior
Gavin Bisesi
@Daenyth
It may have / probably should be printing the failure above that spot
how are you invoking the app?
Drew Boardman
@drewboardman
yeah my failure is printing
right above it
i'm just putting this function call in IOApp and running it
Gavin Bisesi
@Daenyth
with sbt run?
this seems pretty expected
Paul Snively
@paul-snively
Yep. You're saying "when things go south, raiseError", and that's, as you would hope, causing IOApp to exit with an error status.
Drew Boardman
@drewboardman
yeah
ok ty
Yilin Wei
@yilinwei
I'm having some problems using the http4s/http4s-jdk-http-client#116. The issue I'm having is that when this error message is thrown, I can't seem to reconnect at all (it keeps throwing the same error message) . Looking through the code I don't see anything being reused so I'm not sure why it should happen. It's on an external service and I haven't managed to replicate it locally. I was thinking it could be DNS connection issues, but I'd expect a different error message. Has anyone else seen the same issues?
bouncing the process allows a reconnect.
Yilin Wei
@yilinwei
OK - I think I'm being slightly mislead here; it looks as though the JdkWsClient simply discards the error from the WsListener
amesgen
@amesgen
@yilinwei I commented on the issue. Feel free to comment there or here on Gitter.
Yilin Wei
@yilinwei
@amesgen I've replied. I think I know what the issue is, but it's pretty hard to debug. I haven't been able to repro easily and since it's an external service I don't know whether it's sane or not.
Fabrice Sznajderman
@Fabszn
Hi
I faced with strange thing
I woul like to answer an response with Unauthorized Status
Fabrice Sznajderman
@Fabszn
And I cannot use status as follow : Unauthorized("you are not authorized")
Gavin Bisesi
@Daenyth
you probably are missing one of the dsls
extends Http4sDsl[F] or so
Fabrice Sznajderman
@Fabszn
@Daenyth What do you mean?
Gavin Bisesi
@Daenyth
That isn't a method on Unauthorized, it's available via implicits
Christopher Davenport
@ChristopherDavenport
Thats not a challeng.
Unauthorized requires a challenge header to the user, or you can instead do Response[F](Status.Unauthorized) if you’d like to go around the spec, but it clearly indicates a challenge is required.
Ok(“you are not authorized”).map(_.copy(status = Status.Unauthorized)) may also work, but these are all workaround for the fact that no challenges are being offered as they are supposed to be.
Fabrice Sznajderman
@Fabszn
I don't understand what is challeng
Christopher Davenport
@ChristopherDavenport

https://github.com/http4s/http4s/blob/master/core/src/main/scala/org/http4s/Challenge.scala

https://tools.ietf.org/html/rfc7235#section-3.1 - Basically its something to populate the WWW-Authenticate header field, so you need to provide that header. That header consists of atleast 1 challenge for the caller in order to become authorized.

Fabrice Sznajderman
@Fabszn
Thanks for your answer @ChristopherDavenport !
Gavin Bisesi
@Daenyth
Are there examples of invoking a multipart form with form params and multiple content attachments + inlines ?
Gavin Bisesi
@Daenyth
Equivalent to curl with multiple -F attachment=@path params (and also other -F params)
Christopher Davenport
@ChristopherDavenport
It should ideally be mostly self-explanatory but I can build one if we need.
Gavin Bisesi
@Daenyth
It may be so to someone more familiar with the spec and with forms/attachments than me
I at least 100% of the time have to refer to the docs + examples, it just doesn't stick. And I don't see a complex example. I did find this: https://github.com/http4s/http4s/blob/v0.20.15/examples/blaze/src/main/scala/com/example/http4s/blaze/ClientMultipartPostExample.scala
my http knowledge is "json goes in the entity body and other stuff doesn't exist" :P
Christopher Davenport
@ChristopherDavenport
So a multipart, is just a list of parts
Parts have several constructors depending on what type of part you want
the last one could likely be populated by fs2 based streamed files.
Happy to answer any more specific questions.
Gavin Bisesi
@Daenyth

In the very specific, I'm porting mailgun4s to http4s because it's been a source of frustration.

Specifically these confuse me: https://github.com/outr/mailgun4s/blob/master/src/main/scala/org/matthicks/mailgun/Mailgun.scala#L91-L98

Referring to this: https://documentation.mailgun.com/en/latest/api-sending.html#sending

I have most of the other code in that file (and the related data types) ported already

gotta run but if you have a pointer I'll check back on it later
thanks!
Christopher Davenport
@ChristopherDavenport
So all of those are Part.fileData -
Specifically those are all java.io.Files in the attachments. So this method will be precisely what you need. And to convert that header naming for content type into http4s based types. But otherwise those will just fall into place easily.