Skip to content

Commit

Permalink
Merge pull request appsignal#876 from appsignal/dyalizer-nif-warning
Browse files Browse the repository at this point in the history
Add string cast to agent diagnose
  • Loading branch information
luismiramirez authored Aug 9, 2023
2 parents 7b3875b + 11ee579 commit 92ed7fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions dialyzer.ignore-warnings
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ lib/appsignal/json.ex:31: Unknown function 'Elixir.Jason':encode/1
lib/appsignal/json.ex:32: Unknown function 'Elixir.Jason':'encode!'/1
lib/appsignal/json.ex:33: Unknown function 'Elixir.Jason':decode/1
lib/appsignal/json.ex:34: Unknown function 'Elixir.Jason':'decode!'/1
lib/appsignal/diagnose/agent.ex:12: The call 'Elixir.Appsignal.Json':decode(_report_string@1::'error') will never return since it differs in the 1st argument from the success typing arguments: (binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []))
lib/mix/tasks/appsignal.diagnose.ex:55: The pattern {'ok', _agent_report@1} can never match the type {'error','nif_not_loaded'}
lib/mix/tasks/appsignal.diagnose.ex:64: The pattern {'error', _raw_report@1} can never match since previous clauses completely covered the type {'error','nif_not_loaded'}
lib/mix/tasks/appsignal.diagnose.ex:244: Function print_agent_diagnostics/1 will never be called
2 changes: 1 addition & 1 deletion lib/appsignal/diagnose/agent.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Appsignal.Diagnose.Agent do

def report do
if @nif.loaded?() do
report_string = @nif.diagnose()
report_string = to_string(@nif.diagnose)

case Appsignal.Json.decode(report_string) do
{:ok, report} -> {:ok, report}
Expand Down

0 comments on commit 92ed7fa

Please sign in to comment.