Poison.EncodeError when incoming post request fails

Since poison is involved as well as a :safe-tuple, it seems as if you render some *.html but then you try to encode that as JSON.

And poison has no clue how to do that, since there is no replacement for a tuple in JSON as well as you can’t convert improper lists to JSON.

Therefore I think, there is happening something weird in your corresponding action.


edit

I have just seen, that you are rendering “500.html” as the default fallback. Please try to filter on the requested format like this:

def template_not_found(template, assigns) do
  render "500#{Path.extname template}", assigns
end

Also make sure you do have a corresponding template for all fileexetensions that are somehow generated dynamically and thus could produce a 500y error.

2 Likes