我正在尝试用毒药对这个字符串元组进行编码:
{"product existed but could not add categories to product",
"Shop existed but could not add product to shop"}
收到此错误:
19:10:21.593 [error] #PID<0.339.0> running Api.Router terminated
Server: 192.168.20.3:4000 (http)
Request: POST /products
** (exit) an exception was raised:
** (Poison.EncodeError) unable to encode value: {"product existed but could not add categories to product", "Shop ex
isted but could not add product to shop"}
(poison) lib/poison/encoder.ex:383: Poison.Encoder.Any.encode/2
(poison) lib/poison/encoder.ex:227: anonymous fn/4 in Poison.Encoder.Map.encode/3
(poison) lib/poison/encoder.ex:228: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
(poison) lib/poison/encoder.ex:228: Poison.Encoder.Map.encode/3
(poison) lib/poison.ex:41: Poison.encode!/2
(api) lib/api/router.ex:90: anonymous fn/1 in Api.Router.do_match/4
(api) lib/api/router.ex:1: Api.Router.plug_builder_call/2
(api) lib/plug/debugger.ex:123: Api.Router.call/2
Poison 可以对字符串元组进行编码,还是我应该将类型更改为errors
其他类型?