diff options
author | Badlop <badlop@process-one.net> | 2010-01-11 22:21:23 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2010-01-11 22:21:23 +0000 |
commit | 4f643ce9b85a28114b9455480f2715aff88e314a (patch) | |
tree | eeeb5f991b7f2c99f49d0f4f72de321bc206e608 | |
parent | Minor case code simplification. (diff) |
Show and throw error when captcha_cmd is required but not configured.
SVN Revision: 2874
-rw-r--r-- | src/ejabberd_captcha.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index 317798862..4d3d2e009 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -328,7 +328,9 @@ get_prog_name() -> FileName when is_list(FileName) -> FileName; _ -> - "" + ?CRITICAL_MSG("The option captcha_cmd is not configured, but some " + "module wants to use the CAPTCHA feature.", []), + throw({error, option_not_configured_captcha_cmd}) end. get_url(Str) -> @@ -388,9 +390,10 @@ return(Port, TRef, Result) -> Result. is_feature_enabled() -> - case get_prog_name() of - "" -> false; + try get_prog_name() of Prog when is_list(Prog) -> true + catch + _:_ -> false end. is_feature_available() -> |