With the last release of basic-cli, the signature from Http.send!
changed from Request => Result Response [HttpErr Err] to Request => Response ( I changed the old signature to use purity inference for better comparison).
I could not find any discussion about this.
The old API distinct between an error that happens on the other computer (the webserver) and on your own computer. When the webserver returns an 500er, the function returns Ok Result{status: 500,...}
. When the request can not be send (for example, there is no internet connection or the url can not be resolved), it returns an Err (HttpErr Err)
.
The new API always returns a Response
. If a local error happens, it generates an Response object with the status 500
and uses the body field for the error message.
I liked the old API better. I think the Response
should only represent the data, that is returned from the webserver. If an error happens on your own computer, it is not a Response, it is an error.
Would you consider changing it back to the old behavior?
I agree, I think it should return a result
I feel like the change was a mistake
Probably unified with some basic webserver apis
Anyway, almost certainly should return a result
@Luke Boswell should be able to provide some good info here
I dont think it was a deliberate decision, just when unifying the API I must have overlooked it. Agree it makes more sense and we should change it back.
Implemented in https://github.com/roc-lang/basic-cli/pull/309
It's just one commit built on top of the latest breaking change... so the PR looks much bigger than it really is.
Needs some QA/testing at some point.
With this (and snake builtins) merged, is there any plan for a v0.19.0 on the near horizon?
We're making a whole lot of breaking changes soon with snake_case builtins, PNC syntax, and more
Once that drops, yes
Before that can happen, we want to finish with the easy breaking syntax changes
Aka ${interpolation}
and || x + 123
Sweet, makes sense. :working_on_it:
Last updated: Jul 06 2025 at 12:14 UTC