DenisGorbachev

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

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

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 :wink:

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Can you supply a full stack trace?

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Ok, can you show us the Elixir.CoinHunter.Fetchers.Orders':handle_info function?

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement