Skip to content

Error messages for incorrect arguments #147

@HaleTom

Description

@HaleTom

I was doing:

    response = Nadia.get_updates(unseen_id)

And got:

[error] GenServer #PID<0.605.0> terminating
** (FunctionClauseError) no function clause matching in Nadia.API.build_request/2
    (nadia 0.7.0) lib/nadia/api.ex:47: Nadia.API.build_request(43, nil)
    (nadia 0.7.0) lib/nadia/api.ex:119: Nadia.API.request/3
    (app 0.1.1) lib/app/telegram/telegram.ex:87: App.Telegram.handle_info/2
    (stdlib 3.14.1) gen_server.erl:689: :gen_server.try_dispatch/4
    (stdlib 3.14.1) gen_server.erl:765: :gen_server.handle_msg/6
    (stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: :check

Nothing mentioned that a map was expected.

I needed to do instead:

    response = Nadia.get_updates(offset: unseen_id)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions