[erlang-questions] Module config data and functional programming

Per Melin per.melin@REDACTED
Fri Apr 22 19:30:02 CEST 2011

On Fri, Apr 22, 2011 at 4:32 PM, Daniel Dormont
<dan@REDACTED> wrote:
> It also occurs to me that switching to gen_server would offer another advantage in that it would be easy to recover from crashes in my own code. If I were not to do that though, is the recommended practice just to put a 'catch' call around code that might break?

I don't have enough context, but it sounds absolutely unnecessary to
create a gen_server for this.

I would consider it ejabberd's responsibility to handle any crashes in
your code. They have asked you for a callback function and they must
consider that it may break. And they are in a better position than you
to know how to proceed from a crash here. I did have a look in
ejabberd_hooks and they do catch exits from your function. Let it

I'm hesitant to touch the question of what is recommended practice
since this is the kind of thread where Dr Richard O'Keefe usually
comments after a while and turns everyone that posted before him into

More information about the erlang-questions mailing list