Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error after creating/sending message #37

Closed
techgaun opened this issue May 17, 2016 · 3 comments
Closed

Getting error after creating/sending message #37

techgaun opened this issue May 17, 2016 · 3 comments
Labels

Comments

@techgaun
Copy link
Contributor

When I use ExTwilio.Message.create, I receive error but I do receive the message successfully.

The error message reads:

(Protocol.UndefinedError) protocol Enumerable not implemented for %ExTwilio.Message{account_sid: nil, api_version: nil, body: nil, date_created: nil, date_sent: nil, date_updated: nil, direction: nil, error_code: nil, error_message: nil, from: nil, num_media: nil, num_segments: nil, price: nil, price_unit: nil, sid: nil, status: nil, subresource_uri: nil, to: nil, uri: nil}
    (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:116: Enumerable.reduce/3
    (elixir) lib/enum.ex:1477: Enum.reduce/3
    (ex_twilio) lib/ex_twilio/parser.ex:104: ExTwilio.Parser.handle_errors/2

My code looks something like below:

data = [
      from: "+1...",
      to: "+1...",
      body: "Test msg"
    ]
ExTwilio.Message.create(data)

Also, I saw mentions of httpoison. Any plan on switching to httpoison.

@techgaun
Copy link
Contributor Author

techgaun commented May 17, 2016

Was just looking into it again. Apparently, this: https://github.com/danielberkompas/ex_twilio/blob/master/lib/ex_twilio/parser.ex#L51 is causing the issue. Maybe this is causing this: 9f0062c#diff-510db3e3622ff182124ecb4034fbb620

Update: Version 0.1.4 of ex_twilio works fine. Because of my deps (phoenix_ecto and few others I guess), I've to use poison 1.5.2

@danielberkompas
Copy link
Owner

@techgaun which version of ExTwilio has this error?

@techgaun
Copy link
Contributor Author

techgaun commented Jun 6, 2016

@danielberkompas I encountered this with 0.1.7. I was using the poison v. 1.5.2. With 2.x of poison, 0.1.7 just worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants