Skip to content
Browse files

fix dialyzer warnings

  • Loading branch information...
1 parent 9434c0c commit 43f8fe7871a9cff6c96a59ae421c839ee8472521 @vinoski vinoski committed Apr 7, 2013
Showing with 13 additions and 14 deletions.
  1. +4 −4 known_dialyzer_warnings
  2. +9 −10 src/yaws_appmod_dav.erl
View
8 known_dialyzer_warnings
@@ -1,9 +1,9 @@
mime_type_c.erl:69: The variable _ can never match since previous clauses completely covered the type 'true'
-yaws.erl:2410: Guard test Ret::'file' == 'fd' can never succeed
-yaws.erl:2418: Guard test Ret::'file' == 'binfd' can never succeed
-yaws.erl:2649: The pattern 'false' can never match the type 'true'
-yaws.erl:2658: The pattern 'false' can never match the type 'true'
+yaws.erl:2404: Guard test Ret::'file' == 'fd' can never succeed
+yaws.erl:2412: Guard test Ret::'file' == 'binfd' can never succeed
+yaws.erl:2643: The pattern 'false' can never match the type 'true'
+yaws.erl:2652: The pattern 'false' can never match the type 'true'
yaws_ctl.erl:530: Function hup/1 has no local return
yaws_ctl.erl:535: Function stop/1 has no local return
yaws_ctl.erl:539: Function status/1 has no local return
View
19 src/yaws_appmod_dav.erl
@@ -373,14 +373,15 @@ handle("MOVE",A) ->
ok ->
status(201);
_ ->
- case fs_cp(From, To) of
- {ok,_} ->
- fs_rmrf(From),
- status(201);
- {error, Reason} ->
- ?DEBUG(" move from ~p to ~p failed: ~p\n",[From, To, Reason]),
- Response = [{'D:error', [{'xmlns:D',"DAV:"}],[Reason]}],
- status(409,{xml,Response})
+ try
+ fs_cp(From, To),
+ fs_rmrf(From),
+ status(201)
+ catch
+ throw:Status ->
+ ?DEBUG(" move from ~p to ~p failed: ~p\n",[From, To, Status]),
+ Response = [{'D:error', [{'xmlns:D',"DAV:"}],[Status]}],
+ status(Status,{xml,Response})
end
end
end;
@@ -1262,8 +1263,6 @@ status(Status,Headers,Response) ->
end,
[{status, Status},{header,{"DAV","1, 2, 3"}}|H] ++ [Response].
-xml_expand([]) ->
- [];
xml_expand(L) ->
xml_expand(L, "utf-8").
xml_expand(L, Cset) ->

0 comments on commit 43f8fe7

Please sign in to comment.
Something went wrong with that request. Please try again.