Permalink
Browse files

nice cleanup patch from Rickard Bucker

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1184 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 32efdd0 commit 49cbf484261bdc2c17e3793b36a14760a343fc59 @klacke committed Dec 5, 2007
Showing with 26 additions and 26 deletions.
  1. +3 −3 src/yaws.erl
  2. +1 −1 src/yaws_404.erl
  3. +4 −4 src/yaws_api.erl
  4. +3 −3 src/yaws_config.erl
  5. +1 −1 src/yaws_ctl.erl
  6. +3 −3 src/yaws_debug.erl
  7. +10 −10 src/yaws_server.erl
  8. +1 −1 src/yaws_soap_srv.erl
View
@@ -319,7 +319,7 @@ date_and_time_to_string(DAT) ->
true ->
dat2str(DAT);
false ->
- erlang:fault({badarg, {?MODULE, date_and_time_to_string, [DAT]}})
+ erlang:error({badarg, {?MODULE, date_and_time_to_string, [DAT]}})
end.
@@ -1815,7 +1815,7 @@ gen_tcp_send(S, Data) ->
ok ->
ok;
Err ->
- erlang:fault(Err)
+ erlang:error(Err)
end;
true ->
case Res of
@@ -1828,7 +1828,7 @@ gen_tcp_send(S, Data) ->
"on socket ~p: ~p~n~p~n",
[Size, B2, S, Err,
yaws_debug:nobin(Data)]),
- erlang:fault(Err)
+ erlang:error(Err)
end
end.
View
@@ -37,7 +37,7 @@ out404(Arg, GC, SC) ->
-not_found_body(Path, _GC, SC) ->
+not_found_body(Path, _GC, _SC) ->
L = ["<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
"<HTML><HEAD>"
"<TITLE>404 Not Found</TITLE>"
View
@@ -451,7 +451,7 @@ coerce_type(checkbox, "no") ->
coerce_type(checkbox, _Str) ->
off;
coerce_type(ip, _Str) ->
- erlang:fault(nyi_ip);
+ erlang:error(nyi_ip);
coerce_type(binary, Str) ->
list_to_binary(lists:reverse(Str)).
@@ -1368,7 +1368,7 @@ ehtml_apply(Expander, Env) -> [ehtml_eval(X, Env) || X <- Expander].
ehtml_eval(Bin, _Env) when binary(Bin) -> Bin;
ehtml_eval({Type, Var}, Env) ->
case lists:keysearch(Var, 1, Env) of
- false -> erlang:fault({ehtml_unbound, Var});
+ false -> erlang:error({ehtml_unbound, Var});
{value, {Var, Val}} ->
case Type of
ehtml -> ehtml_expand(Val);
@@ -1382,7 +1382,7 @@ ehtml_eval({Type, Var}, Env) ->
ehtml_var_name(A) when atom(A) ->
case ehtml_var_p(A) of
true -> list_to_atom(tl(atom_to_list(A)));
- false -> erlang:fault({bad_ehtml_var_name, A})
+ false -> erlang:error({bad_ehtml_var_name, A})
end.
%% Is X a variable reference? Variable references are atoms starting with $.
@@ -1651,7 +1651,7 @@ postvar(ARG, Key) ->
binding(Key) ->
case get({binding, Key}) of
- undefined -> erlang:fault({unknown_binding, Key});
+ undefined -> erlang:error({unknown_binding, Key});
Value -> Value
end.
View
@@ -1238,7 +1238,7 @@ search_sconf(NewSC, Pairs) ->
_Other ->
error_logger:format("Fatal error, no two sconfs should "
" ever be considered equal ..",[]),
- erlang:fault(fatal_conf)
+ erlang:error(fatal_conf)
end.
%% find the group a new SC would belong to
@@ -1362,7 +1362,7 @@ hard_setconf(GC, Groups) ->
yaws_log:open_trace(What)
end;
E ->
- erlang:fault(E)
+ erlang:error(E)
end.
@@ -1493,7 +1493,7 @@ verify_upgrade_args(GC, Groups0) when record(GC, gconf) ->
end, Groups0),
{GC, Groups};
_ ->
- erlang:fault(badgroups)
+ erlang:error(badgroups)
end.
View
@@ -30,7 +30,7 @@ start(GC, true) ->
ok;
{error, RSN} ->
error_logger:format("~s~n",[RSN]),
- erlang:fault(RSN)
+ erlang:error(RSN)
end.
View
@@ -23,7 +23,7 @@ typecheck([{int, Int} |Tail], File, Line) when integer(Int) ->
typecheck([Err|_], File, Line) ->
io:format(user, "TC ERROR ~s:~w:~n~p",
[File, Line, Err]),
- erlang:fault(tcerr);
+ erlang:error(tcerr);
typecheck([], _,_) ->
ok.
@@ -109,7 +109,7 @@ assert(_,_,_,Failure) ->
fail({assert,File,Line,Message}) ->
io:format(user, "Assertion FAILED ~p:~p, pid ~w exiting: ~p~n",
[File, Line, self(), Message]),
- erlang:fault(assertion_failed);
+ erlang:error(assertion_failed);
fail({alert,File,Line,Message}) ->
io:format(user, "Assert WARNING ~p:~p, pid ~w: ~p~n",
[File, Line, self(), Message]),
@@ -285,7 +285,7 @@ nobin(X) ->
case catch xnobin(X) of
{'EXIT', Reason} ->
error_logger:format("~p~n~p~n", [X, Reason]),
- erlang:fault(Reason);
+ erlang:error(Reason);
Res ->
Res
end.
View
@@ -132,7 +132,7 @@ init(Env) -> %% #env{Trace, TraceOut, Conf, RunMod, Embedded, Id}) ->
end;
EXIT ->
error_logger:format("FATAL ~p~n", [EXIT]),
- erlang:fault(badconf)
+ erlang:error(badconf)
end;
true ->
{ok, #state{gc = undefined,
@@ -183,13 +183,13 @@ start_group(GC, Group) ->
false;
{error, F, A} ->
error_logger:error_msg(F, A),
- erlang:fault(badbind);
+ erlang:error(badbind);
{error, Reason} when FailOnBind == false ->
error_logger:error_msg("FATAL: ~p~n", [Reason]),
false;
{error, Reason} ->
error_logger:error_msg("FATAL: ~p~n", [Reason]),
- erlang:fault(badbind);
+ erlang:error(badbind);
{Pid, SCs} ->
{true, {Pid, SCs}};
none ->
@@ -341,7 +341,7 @@ handle_info({'EXIT', Pid, Reason}, State) ->
{value, _} ->
%% one of our gservs died
error_logger:format("yaws: FATAL gserv died ~p~n", [Reason]),
- erlang:fault(restartme);
+ erlang:error(restartme);
false ->
ignore
end,
@@ -441,7 +441,7 @@ setup_dirs(GC) ->
error_logger:format("Failed to list ~p probably "
"due to permission errs: ~p",
[TD1, RSN]),
- erlang:fault(RSN)
+ erlang:error(RSN)
end.
@@ -523,7 +523,7 @@ gserv_loop(GS, Ready, Rnum, Last) ->
false ->
error_logger:error_msg("gserv: No found SC ~p/~p~n",
[OldSc, GS#gs.group]),
- erlang:fault(nosc);
+ erlang:error(nosc);
true ->
stop_ready(Ready, Last),
NewSc2 = clear_ets_complete(NewSc),
@@ -543,7 +543,7 @@ gserv_loop(GS, Ready, Rnum, Last) ->
case lists:member(OldSc, GS#gs.group) of
false ->
error_logger:error_msg("gserv: No found SC ~n",[]),
- erlang:fault(nosc);
+ erlang:error(nosc);
true ->
stop_ready(Ready, Last),
GS2 = GS#gs{group = lists:delete(OldSc,GS#gs.group)},
@@ -2093,7 +2093,7 @@ stream_loop_send(Priv, CliSock, FlushStatus) ->
after TimeOut ->
case FlushStatus of
flushed ->
- erlang:fault(stream_timeout);
+ erlang:error(stream_timeout);
unflushed ->
P = sync_streamcontent(Priv, CliSock),
stream_loop_send(P, CliSock, flushed)
@@ -2576,7 +2576,7 @@ expand_parts([{var, V} |T] , Bs, Ack) ->
{ok, Val} ->
expand_parts(T, Bs, [Val|Ack]);
{error, ErrStr} ->
- erlang:fault(ErrStr)
+ erlang:error(ErrStr)
end;
{value, {_, Val}} ->
expand_parts(T, Bs, [Val|Ack]);
@@ -3242,7 +3242,7 @@ do_url_type(SC, GetPath, ArgDocroot, VirtualDir) ->
case Mount of
[$/] ->
%%'root' appmod
- PreSegments = [],
+ _PreSegments = [],
PostSegments = lists:sublist(RequestSegs,1,
length(RequestSegs)),
Prepath = "";
View
@@ -69,7 +69,7 @@ handler(Args, Id, Payload, SessionValue) ->
end.
%% Setup a SOAP interface according to the config file.
-setup(ConfigFile) ->
+setup(_ConfigFile) ->
tbd.
setup(Id, WsdlFile) when tuple(Id),size(Id)==2 ->

0 comments on commit 49cbf48

Please sign in to comment.