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

Add Kino.start_child!/1 #322

Merged
merged 2 commits into from
Aug 29, 2023
Merged

Add Kino.start_child!/1 #322

merged 2 commits into from
Aug 29, 2023

Conversation

jonatanklosko
Copy link
Member

🐈

@josevalim
Copy link
Contributor

Let’s steal the reason formatting from this function: https://github.com/elixir-lang/elixir/blob/v1.15.5/lib/ex_unit/lib/ex_unit/callbacks.ex#L568

:) probably worth adding a start_child! to Elixir itself.

defp start_supervised_error({reason, info}) when is_tuple(info),
do: Exception.format_exit(reason)

defp start_supervised_error(reason), do: Exception.format_exit(reason)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExUnit does {:start_spec, reason}, but I think it is confusing since it doesn't really have to do with the child spec itself:

** (RuntimeError) failed to start child with the spec Foo.
Reason: bad child specification, got: {:already_started, #PID<0.330.0>}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your call if you want to change it here. :)

@jonatanklosko jonatanklosko merged commit 4c72a93 into main Aug 29, 2023
1 check passed
@jonatanklosko jonatanklosko deleted the jk-start-child branch August 29, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants