Skip to content

Refactor structure error#57

Merged
Rados13 merged 5 commits intomasterfrom
refactor_structure_error
Feb 22, 2024
Merged

Refactor structure error#57
Rados13 merged 5 commits intomasterfrom
refactor_structure_error

Conversation

@Rados13
Copy link
Copy Markdown
Contributor

@Rados13 Rados13 commented Feb 15, 2024

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 15, 2024

Codecov Report

Merging #57 (308beec) into master (167a774) will increase coverage by 2.11%.
Report is 1 commits behind head on master.
The diff coverage is 70.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   80.00%   82.11%   +2.11%     
==========================================
  Files          18       18              
  Lines         260      246      -14     
==========================================
- Hits          208      202       -6     
+ Misses         52       44       -8     
Files Coverage Δ
lib/jellyfish/exception.ex 66.66% <ø> (ø)
lib/jellyfish/recording.ex 83.33% <100.00%> (+13.33%) ⬆️
lib/jellyfish/component.ex 90.00% <0.00%> (ø)
lib/jellyfish/health.ex 71.42% <50.00%> (+11.42%) ⬆️
lib/jellyfish/peer.ex 83.33% <0.00%> (ø)
lib/jellyfish/room.ex 96.96% <90.00%> (+5.71%) ⬆️
lib/jellyfish/track.ex 75.00% <0.00%> (ø)
lib/jellyfish/utils.ex 90.00% <75.00%> (-2.31%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 167a774...308beec. Read the comment docs.

@Rados13 Rados13 force-pushed the refactor_structure_error branch from a9dd32f to 2dee310 Compare February 16, 2024 13:33
@Rados13 Rados13 marked this pull request as ready for review February 16, 2024 13:46
@Rados13 Rados13 self-assigned this Feb 16, 2024
@Rados13 Rados13 requested a review from sgfn February 16, 2024 13:46
Comment thread lib/jellyfish/exception.ex Outdated
Comment thread lib/jellyfish/peer.ex Outdated
Comment on lines +10 to +11
require Logger

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Comment thread lib/jellyfish/utils.ex
Comment on lines +27 to +55
def make_get_request!(client, path) do
with {:ok, %Env{status: 200, body: body}} <- Tesla.get(client.http_client, path) do
data =
case Map.fetch(body, "data") do
{:ok, data} -> data
:error -> raise StructureError, body
end

{:ok, data}
else
error -> handle_response_error(error)
end
end

def make_post_request!(client, path, request_body) do
with {:ok, %Env{status: 201, body: body}} <-
Tesla.post(client.http_client, path, request_body) do
data =
case Map.fetch(body, "data") do
{:ok, data} -> data
:error -> raise StructureError, body
end

{:ok, data}
else
error -> handle_response_error(error)
end
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick but I suppose we could merge the same parts under a defp make_request!(method, client, path, body)

Comment thread lib/jellyfish/room.ex Outdated
Rados13 and others added 3 commits February 22, 2024 09:43
Co-authored-by: Jakub Pisarek <99591440+sgfn@users.noreply.github.com>
Co-authored-by: Jakub Pisarek <99591440+sgfn@users.noreply.github.com>
@Rados13 Rados13 merged commit 3a0a773 into master Feb 22, 2024
@Rados13 Rados13 deleted the refactor_structure_error branch February 22, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants