aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 15:22:03 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 15:22:03 +0200
commit84937b0728ae3aac1174b32c85df17cf8bf627a5 (patch)
tree12b103989f52e5e3242d8637fb002704b4bd8a8e
parent4cf29d9ea1d52f2fb16634d65c2c0808e20a94b5 (diff)
downloaderlang-84937b0728ae3aac1174b32c85df17cf8bf627a5.tar.gz
erlang-84937b0728ae3aac1174b32c85df17cf8bf627a5.tar.xz
erlang-84937b0728ae3aac1174b32c85df17cf8bf627a5.zip
added better error messages
-rw-r--r--server/dispatcher.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/server/dispatcher.erl b/server/dispatcher.erl
index 77e4ab9..882bed3 100644
--- a/server/dispatcher.erl
+++ b/server/dispatcher.erl
@@ -5,12 +5,20 @@ start() ->
code:purge(server),
code:load_abs("../common/server"),
- spawn(media, init, []),
+ try spawn(media, init, []) of
+ _ ->
+ io:format("Media-Backend started!~n")
+ catch
+ _: Why ->
+ io:format("Error starting media backend: ~w! Exiting.~n", [Why]),
+ exit(1)
+ end,
- case server:start(dis, dispatcher) of
+ try server:start(dis, dispatcher) of
true ->
- io:format("Server started... ~n"),
- true;
+ io:format("Server started!~n"),
+ true
+ catch
_ ->
io:format("Error starting server! Exiting.~n"),
exit(1)
@@ -44,5 +52,5 @@ handle({login, {Node, User, Password}}, Dict) ->
handle({'EXIT', _, _}, Dict) ->
Dict;
-handle(_, Dict) ->
- {{error, unknown_command}, Dict}.
+handle(Cmd, Dict) ->
+ {{error, {unknown_command, Cmd}}, Dict}.