Erlang/OTP Forums

Author Message

<  Advanced Erlang/OTP  ~  [Yaws] redirect not allowed in errmod_crash

mpquique
Posted: Mon Oct 16, 2006 5:57 pm Reply with quote
Joined: 10 Aug 2006 Posts: 4 Location: La Coruña, Spain
Hi all,

Why a redirect_local is not permitted as return value for errmod_crash in Yaws? I would find it very convenient and I'm curious why is explicitly avoided in the source code.

Code:

handle_crash(A, L) ->
    ?Debug("handle_crash(~p)~n", [L]),
    SC=get(sc),
    yaws:elog("~s", [L]),
    case catch apply(SC#sconf.errormod_crash, crashmsg, [A, SC, L]) of
        {html, Str} ->
            accumulate_content(Str),
            break;
        {ehtml, Term} ->
            case safe_ehtml_expand(Term) of
                {error, Reason} ->
                    yaws:elog("~s", [Reason]),
                    %% Aghhh, yet another user crash :-(
                    T2 = [{h2, [], "Internal error"}, {hr},
                          {p, [], "Customized crash display code crashed !!!"}],
                    accumulate_content(ehtml_expand(T2)),
                    break;
                {ok, Out} ->
                    accumulate_content(Out),
                    break
            end;
        Other ->
            yaws:elog("Bad return value from errmod_crash ~n~p~n",[Other]),
            T2 = [{h2, [], "Internal error"}, {hr},
                  {p, [], "Customized crash display code returned bad val"}],
            accumulate_content(ehtml_expand(T2)),
            break

    end.


I would prefer to have my ehtml code all in yaws files Smile and this forces me to have error pages in a regular erlang module.

Thanks in advance,

Quique[/code]

_________________
http://www.nomasystems.com
View user's profile Send private message Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum