DenisGorbachev
(MatchError) no match of right hand side value: {:error, {:invalid, "T", 0}}
Hello!
We’re getting (MatchError) no match of right hand side value: {:error, {:invalid, "T", 0}} quite randomly, haven’t been able to trace it down to specific issue - has anybody seen this?
Marked As Solved
DenisGorbachev
Got it! The error was coming from Poison, the JSON parser, when it couldn’t parse the string. To see the string that caused the error, I’ve switched to exceptions for error handling, and also extended the default message to include the unparsable string:
def parse!(json) do
try do
Poison.Parser.parse!(json)
rescue
e in Poison.SyntaxError -> raise %{e | message: "#{e.message} (trying to parse \"#{json}\")"}
end
end
Thanks everybody for help!
Also Liked
PatNowak
The easiest way to trace the bug, if you don’t provide us more info is:
use break if you have Elixir 1.5. Just run your server with iex -S mix phx.server.
The issues lies with the assignment that is in your function - you expect that result would be in specific format, but suddenly the one, you receive in that handle_info is different eg. {:ok, result} = Repo.insert(changeset) may throw you {:error, changeset}, so it will not match.
You can try to remove this pattern matching and log / debug what it’s the result.
Certainly more details would provide better answer from our side ![]()
benwilson512
Can you supply a full stack trace?
benwilson512
Ok, can you show us the Elixir.CoinHunter.Fetchers.Orders':handle_info function?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









