If i write some erlang code to build a supervision tree and then launch the application at the boot whith the following command, it may be very hard to find out why it doesn't work :
erl -s myapp -pa ebin ... ...
(myapp example module)
-module(myapp).
-export([start/0]).
start() -> application:start(myapp).
Let's say that my app launches a supervisor, myapp_sup. myapp_sup launches at its turn several supervisors (let's say server_sup, database_sup, another_sup).
Theese supervisors will launch some gen_servers.
At some point, if there is a mistake in my code, i cannot find it out !
I wrote a call to somemodule:functionthatdoesntexists() in the init callback of some gen_server.
All the vm says is "init terminating in do boot" and then display error location of a badmatch, precising file and line of my top module (myapp).
(Badmatch because ok = application:start(...) will not match).
I look in th erl_crash.dump file, and there is no information about this undefined function (yet i find it in the atoms list).
So, i wrote some log to see approximatively where is the error, but then i'll have to launch my gen_servers by the hand to get back the correct error information.
What am i missing, how could i figure it out faster ?
Thanks