mirror of
https://github.com/woutdp/live_svelte
synced 2026-05-24 09:28:21 +00:00
Raise when Jason.encode/1 fails on props
When passing in props that fails to Jason.encode, raise. (Prior behavior was to fail silently.)
This commit is contained in:
parent
24eb71ded5
commit
a7bc1af475
1 changed files with 1 additions and 6 deletions
|
|
@ -122,12 +122,7 @@ defmodule LiveSvelte do
|
|||
end
|
||||
|
||||
defp json(props) do
|
||||
props
|
||||
|> Jason.encode()
|
||||
|> case do
|
||||
{:ok, encoded} -> encoded
|
||||
{:error, _} -> ""
|
||||
end
|
||||
Jason.encode!(props)
|
||||
end
|
||||
|
||||
defp id(name), do: "#{name}-#{System.unique_integer([:positive])}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue