             name
         end
 
-      case Application.load(app_name) do
+      case validate_app(app_name) do
         :ok ->
-          :ok
-
-        {:error, {:already_loaded, _}} ->
           :ok
 
         {:error, reason} ->

  defp add_app(dg, as, parent, {name, start_type}) do
    case :digraph.vertex(dg, name) do
      false ->
        # Haven't seen this app yet, and it is not excluded
        do_add_app(dg, as, parent, App.new(name, start_type))

      _ ->
        # Already visited
        :ok

    Shell.debugf("  |_____\n\n")
    do_print_discovered_apps(apps)
  end

  defp validate_app(app_name) do
    case Application.load(app_name) do
      :ok ->
        :ok

      {:error, {:already_loaded, _}} ->
        :ok

      error -> 
        error
    end
  end
end
