aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2010-11-30 14:41:06 +0100
committerIngela Anderton Andin <[email protected]>2010-11-30 14:41:06 +0100
commitf05d42599f3c8fa3632ca04c21a5f91100275feb (patch)
tree5c52a733686e00eebbc45f54139f5cbd7bd59dd7 /lib/inets
parentd678ee003cd02d3cdffabfd13cc96f8d493dbf0d (diff)
downloadotp-f05d42599f3c8fa3632ca04c21a5f91100275feb.tar.gz
otp-f05d42599f3c8fa3632ca04c21a5f91100275feb.tar.bz2
otp-f05d42599f3c8fa3632ca04c21a5f91100275feb.zip
Changed file error handling to be consistent
Internal server error is only used for emfile and enfile all other errors are treated as 404 file not found, except 403 eacces.
Diffstat (limited to 'lib/inets')
-rw-r--r--lib/inets/src/http_server/httpd_file.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/inets/src/http_server/httpd_file.erl b/lib/inets/src/http_server/httpd_file.erl
index 14ae5de73f..7e21d9e158 100644
--- a/lib/inets/src/http_server/httpd_file.erl
+++ b/lib/inets/src/http_server/httpd_file.erl
@@ -26,9 +26,9 @@
handle_error(eacces, Op, ModData, Path) ->
- handle_error(403, Op, ModData, Path,"");
+ handle_error(403, Op, ModData, Path,"Forbidden");
handle_error(enoent, Op, ModData, Path) ->
- handle_error(404, Op, ModData, Path,"");
+ handle_error(404, Op, ModData, Path,"File not found");
handle_error(enotdir, Op, ModData, Path) ->
handle_error(404, Op, ModData, Path,
": A component of the file name is not a directory");
@@ -36,8 +36,8 @@ handle_error(emfile, Op, _ModData, Path) ->
handle_error(500, Op, none, Path, ": To many open files");
handle_error({enfile,_}, Op, _ModData, Path) ->
handle_error(500, Op, none, Path, ": File table overflow");
-handle_error(_Reason, Op, _ModData, Path) ->
- handle_error(500, Op, none, Path, "").
+handle_error(_Reason, Op, ModData, Path) ->
+ handle_error(404, Op, ModData, Path, "File not found").
handle_error(StatusCode, Op, none, Path, Reason) ->
{StatusCode, none, ?NICE("Can't " ++ Op ++ Path ++ Reason)};