NervesHub.Connection is called when making HTTP requests to mark successful connections. However, it is started with the NervesHub.Supervisor which isn't typically present for HTTP use-cases of this lib, so things crash and fail.
This adds a note to the doc about how to use NervesHub.Connection if using HTTP only. Also makes the function calls safer by returning an {:error, :no_agent} tuple if the agent with connection state cannot be found.
Fixes https://github.com/nerves-hub/nerves_hub/issues/113
NervesHub.Connection
is called when making HTTP requests to mark successful connections. However, it is started with theNervesHub.Supervisor
which isn't typically present for HTTP use-cases of this lib, so things crash and fail.This adds a note to the doc about how to use
NervesHub.Connection
if using HTTP only. Also makes the function calls safer by returning an{:error, :no_agent}
tuple if the agent with connection state cannot be found.