honeybadger-io / honeybadger-elixir

Elixir client for Honeybadger.
MIT License
180 stars 56 forks source link

Is this documentation outdated? #301

Open joshuap opened 4 years ago

joshuap commented 4 years ago

The README and code docs for Honeybadger.notify say to pass the context as the second argument:

https://github.com/honeybadger-io/honeybadger-elixir/blob/d051f0754dd44e13c9cc7c989d7fdfc5cb068f82/lib/honeybadger.ex#L44

...but it looks like the second argument is actually metadata, which expects a context key:

https://github.com/honeybadger-io/honeybadger-elixir/blob/c2dc31100fb764ad4b0c4df6bf94bdef0bbc8984/lib/honeybadger/notice.ex#L58

Should it be Honeybadger.notify(exception, context), or Honeybadger.notify(exception, %{context: context})? I may be forgetting how this works.

cc @rabidpraxis @sorentwo

sorentwo commented 4 years ago

@joshuap The second argument is the metadata and not the context. To pass in context you need the %{context: context} map.

rabidpraxis commented 4 years ago

@joshuap Notice.new expects a map with :context, but it looks like Honeybadger.notify will jam all metadata the into the context key if its not already present:

https://github.com/honeybadger-io/honeybadger-elixir/blob/24edb30cb2a2c9462bdc453c9943fa64ef9bac00/lib/honeybadger.ex#L253-L257

https://github.com/honeybadger-io/honeybadger-elixir/blob/24edb30cb2a2c9462bdc453c9943fa64ef9bac00/lib/honeybadger.ex#L428-L435

joshuap commented 4 years ago

@rabidpraxis oh OK, so our docs are actually valid? Is there a method you prefer?

rabidpraxis commented 4 years ago

I'm not sure. I probably swing towards favoring the explicit version, just for readability sake.

hypernumbers commented 5 days ago

The README is - it tells you to go and watch an Elixir Sips screencast - and the link doesn't work

https://hexdocs.pm/honeybadger/readme.html

gordonguthrie commented 4 days ago

The README is - it tells you to go and watch an Elixir Sips screencast - and the link doesn't work

https://hexdocs.pm/honeybadger/readme.html

This is corrected in the github repo - so please ignore