Current section
40 Versions
Jump to
Current section
40 Versions
Compare versions
5
files changed
+29
additions
-7
deletions
| @@ -1,11 +1,18 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## v0.16.0 (2023-04-13) |
| 4 | + |
| 5 | + ### Enhancements |
| 6 | + |
| 7 | + - add `Finch.request!/3` #219 |
| 8 | + - allow usage with nimble_pool 1.0 #220 |
| 9 | + |
| 3 10 | ## v0.15.0 (2023-03-16) |
| 4 11 | |
| 5 12 | ### Enhancements |
| 6 13 | |
| 7 | - - allow usage with nimble_options 1.0 |
| 8 | - - allow usage with castore 1.0 |
| 14 | + - allow usage with nimble_options 1.0 #218 |
| 15 | + - allow usage with castore 1.0 #210 |
| 9 16 | |
| 10 17 | ## v0.14.0 (2022-11-30) |
| @@ -105,7 +105,7 @@ The package can be installed by adding `finch` to your list of dependencies in ` | |
| 105 105 | ```elixir |
| 106 106 | def deps do |
| 107 107 | [ |
| 108 | - {:finch, "~> 0.15"} |
| 108 | + {:finch, "~> 0.16"} |
| 109 109 | ] |
| 110 110 | end |
| 111 111 | ``` |
| @@ -32,7 +32,7 @@ | |
| 32 32 | {<<"name">>,<<"nimble_pool">>}, |
| 33 33 | {<<"optional">>,false}, |
| 34 34 | {<<"repository">>,<<"hexpm">>}, |
| 35 | - {<<"requirement">>,<<"~> 0.2.6">>}], |
| 35 | + {<<"requirement">>,<<"~> 0.2.6 or ~> 1.0">>}], |
| 36 36 | [{<<"app">>,<<"nimble_options">>}, |
| 37 37 | {<<"name">>,<<"nimble_options">>}, |
| 38 38 | {<<"optional">>,false}, |
| @@ -48,4 +48,4 @@ | |
| 48 48 | {<<"optional">>,false}, |
| 49 49 | {<<"repository">>,<<"hexpm">>}, |
| 50 50 | {<<"requirement">>,<<"~> 1.0 or ~> 2.0">>}]]}. |
| 51 | - {<<"version">>,<<"0.15.0">>}. |
| 51 | + {<<"version">>,<<"0.16.0">>}. |
| @@ -344,4 +344,19 @@ defmodule Finch do | |
| 344 344 | build(method, url, headers, body) |
| 345 345 | |> request(name, opts) |
| 346 346 | end |
| 347 | + |
| 348 | + @doc """ |
| 349 | + Sends an HTTP request and returns a `Finch.Response` struct |
| 350 | + or raises an exception in case of failure. |
| 351 | + |
| 352 | + See `request/3` for more detailed information. |
| 353 | + """ |
| 354 | + @spec request!(Request.t(), name(), keyword()) :: |
| 355 | + Response.t() |
| 356 | + def request!(%Request{} = req, name, opts \\ []) do |
| 357 | + case request(req, name, opts) do |
| 358 | + {:ok, resp} -> resp |
| 359 | + {:error, exception} -> raise exception |
| 360 | + end |
| 361 | + end |
| 347 362 | end |
| @@ -2,7 +2,7 @@ defmodule Finch.MixProject do | |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 4 | @name "Finch" |
| 5 | - @version "0.15.0" |
| 5 | + @version "0.16.0" |
| 6 6 | @repo_url "https://github.com/sneako/finch" |
| 7 7 | |
| 8 8 | def project do |
| @@ -35,7 +35,7 @@ defmodule Finch.MixProject do | |
| 35 35 | [ |
| 36 36 | {:mint, "~> 1.3"}, |
| 37 37 | {:castore, "~> 0.1 or ~> 1.0"}, |
| 38 | - {:nimble_pool, "~> 0.2.6"}, |
| 38 | + {:nimble_pool, "~> 0.2.6 or ~> 1.0"}, |
| 39 39 | {:nimble_options, "~> 0.4 or ~> 1.0"}, |
| 40 40 | {:telemetry, "~> 0.4 or ~> 1.0"}, |
| 41 41 | {:mime, "~> 1.0 or ~> 2.0"}, |