Handling empty responses in ewgi_mochiweb

1 view
Skip to first unread message

Zed

unread,
Jan 17, 2010, 1:43:10 PM1/17/10
to ewgi
Hi!

The current ewgi_mochiweb module will fail if the reponse status is
not set. Specifically on this match:
"Code, _} = ewgi_api:response_status(Ctx)". Is this intentional?

I know I could check if a response is generated or not in my own loop
function, but I think this could be handled in a more graceful way...

Regards,
Zoltan.

Zed

unread,
Jan 17, 2010, 2:43:41 PM1/17/10
to ewgi
Also changing "error_logger:error_report(Reason)" to something like
"error_report({error, Reason}, {stack, erlang:get_stacktrace()})"
would be nice.
At least seeing an Error report "undef" is not helpful at all...

filippo pacini

unread,
Jan 19, 2010, 5:19:20 AM1/19/10
to ew...@googlegroups.com
Hi Zoltan,
I agree with you we should handle this case more gracefully.

I've added an issue on github.

Thanks for your feedback.
filippo

filippo pacini

unread,
Jan 19, 2010, 5:22:38 AM1/19/10
to ew...@googlegroups.com
IMHO the best way to handle errors would be to have a middleware
module that pretty prints and display errors, or logs them based on
some configuration option.
Reply all
Reply to author
Forward
0 new messages