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

Is this documentation outdated? #301

Open
joshuap opened this issue Jul 10, 2020 · 7 comments
Open

Is this documentation outdated? #301

joshuap opened this issue Jul 10, 2020 · 7 comments
Labels

Comments

@joshuap
Copy link
Member

joshuap commented Jul 10, 2020

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

Honeybadger.notify(exception, context, __STACKTRACE__)

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

|> Map.put(:context, Map.get(metadata, :context, %{}))

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

cc @rabidpraxis @sorentwo

@sorentwo
Copy link
Collaborator

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

@rabidpraxis
Copy link
Contributor

rabidpraxis commented Jul 13, 2020

@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:

metadata_with_breadcrumbs =
metadata
|> Map.delete(:breadcrumbs)
|> contextual_metadata()
|> Map.put(:breadcrumbs, breadcrumbs)

defp contextual_metadata(%{context: _} = metadata) do
metadata
end
defp contextual_metadata(metadata) do
%{context: metadata}
end
end

@joshuap
Copy link
Member Author

joshuap commented Aug 17, 2020

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

@rabidpraxis
Copy link
Contributor

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

@hypernumbers
Copy link

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
Copy link

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

@subzero10
Copy link
Member

Yeah, the markdown is not rendered as expected in hexdocs. You'll be redirected to the screencast if you click on the html tag that appears to be an image:
CleanShot 2024-11-30 at 12 35 40@2x

But if you click on "Watch our screencast", which is right below, you'll be redirected to a login page. I will correct that to take you to the screencast.

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

6 participants