{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/5388","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5388/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5388/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5388/events","html_url":"https://github.com/elixir-lang/elixir/issues/5388","id":186158065,"number":5388,"title":"Improve error messages when something goes wrong","user":{"login":"sylverlion","id":3833987,"avatar_url":"https://avatars.githubusercontent.com/u/3833987?v=3","gravatar_id":"","url":"https://api.github.com/users/sylverlion","html_url":"https://github.com/sylverlion","followers_url":"https://api.github.com/users/sylverlion/followers","following_url":"https://api.github.com/users/sylverlion/following{/other_user}","gists_url":"https://api.github.com/users/sylverlion/gists{/gist_id}","starred_url":"https://api.github.com/users/sylverlion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylverlion/subscriptions","organizations_url":"https://api.github.com/users/sylverlion/orgs","repos_url":"https://api.github.com/users/sylverlion/repos","events_url":"https://api.github.com/users/sylverlion/events{/privacy}","received_events_url":"https://api.github.com/users/sylverlion/received_events","type":"User","site_admin":false},"labels":[{"id":10229539,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Mix","name":"App:Mix","color":"CCCCCC","default":false},{"id":207974,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Bug","name":"Kind:Bug","color":"e10c02","default":false},{"id":39802961,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Level:Intermediate","name":"Level:Intermediate","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-30T19:47:18Z","updated_at":"2016-11-19T19:48:08Z","closed_at":null,"body":"### Environment\n- Elixir version (elixir -v):\n\n```\nErlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\n\nElixir 1.3.4\n```\n- Operating system:\n  `masOS Sierra 10.12`\n### Current behavior\n\nI'm making an umbrella app and I'm using env variables to set a few parameters I need to tweak for my builds in all the apps of the project. Here's an example : \n\n```\n  def project do\n    [app: :auth,\n     version: \"0.1.0\",\n     build_path: System.get_env(\"BUILD_PATH\"),\n     config_path: \"../../config/config.exs\",\n     deps_path: System.get_env(\"DEPS_PATH\"),\n     lockfile: \"../../mix.lock\",\n     elixir: \"~> 1.3\",\n     elixirc_paths: elixirc_paths(Mix.env),\n     compilers: [:phoenix, :gettext] ++ Mix.compilers,\n     build_embedded: Mix.env == :prod,\n     start_permanent: Mix.env == :prod,\n     aliases: aliases(),\n     deps: deps()]\n  end\n```\n\nIf some parameters in the `mix.exs` file are wrong (I have tried with `build_path`and `config_path` so far), the error messages aren't helping at all to debug why an exception is raised.\n\nIf no `build_path` and `deps_path` are set we get : \n\n```\n$> mix deps.get\n** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1\n    (elixir) lib/io.ex:412: IO.chardata_to_string(nil)\n    (elixir) lib/path.ex:619: Path.expand_home/1\n    (elixir) lib/path.ex:139: Path.expand/1\n    (mix) lib/mix/project.ex:83: Mix.Project.deps_config/1\n    (mix) lib/mix/dep.ex:167: Mix.Dep.in_dependency/3\n    (mix) lib/mix/dep/loader.ex:55: Mix.Dep.Loader.load/2\n    (mix) lib/mix/dep/converger.ex:179: Mix.Dep.Converger.all/9\n    (mix) lib/mix/dep/converger.ex:114: Mix.Dep.Converger.all/7\n```\n\nIf `build_path` and `deps_path` are set, but with invalid directories, we get : \n\n```\n$> mix deps.get\nRunning dependency resolution\nDependency resolution completed\n  base64url: 0.0.1\n  comeonin: 2.6.0\n  connection: 1.0.4\n  cowboy: 1.0.4\n  cowlib: 1.0.2\n  db_connection: 1.0.0\n  decimal: 1.2.0\n  ecto: 2.0.5\n  ex_machina: 1.0.2\n  fs: 0.9.2\n  gettext: 0.12.1\n  guardian: 0.13.0\n  jose: 1.8.0\n  mime: 1.0.1\n  phoenix: 1.2.1\n  phoenix_ecto: 3.0.1\n  phoenix_html: 2.7.0\n  phoenix_live_reload: 1.0.0\n  phoenix_pubsub: 1.0.1\n  plug: 1.2.2\n  poison: 2.2.0\n  poolboy: 1.5.1\n  postgrex: 0.12.1\n  ranch: 1.2.1\n  uuid: 1.1.5\n* Getting phoenix (Hex package)\n  Checking package (https://repo.hex.pm/tarballs/phoenix-1.2.1.tar)\n  Fetched package\n** (exit) an exception was raised:\n    ** (MatchError) no match of right hand side value: {:error, :enoent}\n        (stdlib) erl_tar.erl:870: :erl_tar.write_file/2\n        (stdlib) erl_tar.erl:810: :erl_tar.write_extracted_element/3\n        (stdlib) erl_tar.erl:598: :erl_tar.extract1/4\n        (stdlib) erl_tar.erl:571: :erl_tar.foldl_read1/4\n        (stdlib) erl_tar.erl:554: :erl_tar.foldl_read0/4\n        (stdlib) erl_tar.erl:546: :erl_tar.foldl_read/4\n        (hex) lib/hex/tar.ex:95: Hex.Tar.extract_contents/3\n        (hex) lib/hex/tar.ex:44: Hex.Tar.unpack/3\n    (stdlib) erl_tar.erl:556: :erl_tar.foldl_read0/4\n    (stdlib) erl_tar.erl:546: :erl_tar.foldl_read/4\n    (hex) lib/hex/tar.ex:95: Hex.Tar.extract_contents/3\n    (hex) lib/hex/tar.ex:44: Hex.Tar.unpack/3\n    (hex) lib/hex/scm.ex:110: Hex.SCM.checkout/1\n    (mix) lib/mix/dep/fetcher.ex:64: Mix.Dep.Fetcher.do_fetch/3\n    (mix) lib/mix/dep/converger.ex:174: Mix.Dep.Converger.all/9\n    (mix) lib/mix/dep/converger.ex:183: Mix.Dep.Converger.all/9\n```\n### Expected behavior\n\nExpecting mix to have an overall better errors/exceptions handling, and to eventually be able to explicitly point out what's wrong in the configuration file (in the case it's a configuration issue like here).\n\nI know i'm only doing a reporting without having investigate in the code or came up with a pull request for this already, I'd like to, but don't have the time right now, sorry about that. Maybe later if you guys don't have worked on this yet.\n"},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/261735232","html_url":"https://github.com/elixir-lang/elixir/issues/5388#issuecomment-261735232","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5388","id":261735232,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T19:48:08Z","updated_at":"2016-11-19T19:48:08Z","body":"@whatyouhide ping. :)"}}
{"actor":{"display_login":"josevalim"}}