[erlang-bugs] Incorrect or misleading inets/http_server error message

Edwin Fine <>
Mon Jun 30 23:56:58 CEST 2008

Taking the example out of the document at

2> {ok, Pid} = inets:start(httpd, [{port, 0},
2>       {server_name,"httpd_test"}, {server_root,"/tmp"},
2>       {document_root,"/tmp/htdocs"}, {bind_address, "localhost"}]).

=ERROR REPORT==== 30-Jun-2008::17:47:18 ===
Failed initiating web server:

** exception error: no match of right hand side value













The actual problem was that the "/tmp/htdocs" directory did not exist. I
find having an error message of undefined
*to be very misleading. I read it as "the value corresponding to
document_root [i.e. "/tmp/htdocs", of type string] is of the wrong type". If
not a string, what should it be, I wondered?

When I created the directory and tried again, the message went away. I would
have expected to see something like

3> {ok, Pid} = inets:start(httpd, [{port, 0},
3>       {server_name,"httpd_test"}, {server_root,"/tmp"},
3>       {document_root,"/tmp/htdocs"}, {bind_address, "localhost"}]).

Edwin Fine
The great enemy of the truth is very often not the lie -- deliberate,
contrived and dishonest, but the myth, persistent, persuasive, and
unrealistic. Belief in myths allows the comfort of opinion without the
discomfort of thought.
John F. Kennedy 35th president of US 1961-1963 (1917 - 1963)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080630/42628654/attachment.html>

More information about the erlang-bugs mailing list