Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  [RFC] yaws_*rpc:handler

Gaspar
Posted: Wed Jun 27, 2007 7:25 pm Reply with quote
User Joined: 20 Jul 2006 Posts: 55
Hi all!

I would like to implement try/catch extension to yaws:yaws_*rpc modules
handler and handler_session functions.

At current moment I can see in our production code, that
nearly each handler is wrapped in try/catch construct -- which allows us
generate correct error message (like "internal software error", "generic
validation failed" and etc), if message is thrown from deeply nested
code or if some matching fails.

So I would like to add
handler/3 --
handler(Args, Handler, CatchFun)
and
handler_session(Args, Handler, SID_Name, CatchFun)

CatchFun/2 and CatchFun/5 is a fun which is called only when handler
throws some error.

CatchFun(Args, Handler, InData, ErrorType, ErrorMsg) should be used if
one wants full reporting on which arguments fired the error.

CatchFun(ErrorType, ErrorMsg) is a simplified version of previous
function, which just takes care of handling exception.


Your comments and suggestions are welcome.


/Gaspar
--
Gaspar Chilingarov

System Administrator,
Network security consulting

t +37493 419763 (mob)
i 63174784
e nm@web.am
w http://zanazan.am/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
View user's profile Send private message

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 can attach files in this forum
You can download files in this forum