| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ejabberd
Revision: 1540
Author: cromain
Date: 25 Aug 2008 09:36:34
Changes:Prevent case_clause error when ejabber_odbc:sql_query returns {error, Reason}
Files:| ... | ...@@ -116,6 +116,8 @@ | |
| 116 | 116 | case catch odbc_queries:add_spool(Host, Query) of |
| 117 | 117 | {'EXIT', Reason} -> |
| 118 | 118 | ?ERROR_MSG("~p~n", [Reason]); |
| 119 | {error, Reason} -> | |
| 120 | ?ERROR_MSG("~p~n", [Reason]); | |
| 119 | 121 | _ -> |
| 120 | 122 | ok |
| 121 | 123 | end |
| ... | ...@@ -114,8 +114,6 @@ | |
| 114 | 114 | get_last(IQ, SubEl, LUser, LServer) -> |
| 115 | 115 | Username = ejabberd_odbc:escape(LUser), |
| 116 | 116 | case catch odbc_queries:get_last(LServer, Username) of |
| 117 | {'EXIT', _Reason} -> | |
| 118 | IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}; | |
| 119 | 117 | {selected, ["seconds","state"], []} -> |
| 120 | 118 | IQ#iq{type = error, sub_el = [SubEl, ?ERR_SERVICE_UNAVAILABLE]}; |
| 121 | 119 | {selected, ["seconds","state"], [{STimeStamp, Status}]} -> |
| ... | ...@@ -132,7 +130,9 @@ | |
| 132 | 130 | _ -> |
| 133 | 131 | IQ#iq{type = error, |
| 134 | 132 | sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]} |
| 135 | end | |
| 133 | end; | |
| 134 | _ -> | |
| 135 | IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]} | |
| 136 | 136 | end. |
| 137 | 137 | |
| 138 | 138 | on_presence_update(User, Server, _Resource, Status) -> |
| ... | ...@@ -152,8 +152,6 @@ | |
| 152 | 152 | get_last_info(LUser, LServer) -> |
| 153 | 153 | Username = ejabberd_odbc:escape(LUser), |
| 154 | 154 | case catch odbc_queries:get_last(LServer, Username) of |
| 155 | {'EXIT', _Reason} -> | |
| 156 | not_found; | |
| 157 | 155 | {selected, ["seconds","state"], []} -> |
| 158 | 156 | not_found; |
| 159 | 157 | {selected, ["seconds","state"], [{STimeStamp, Status}]} -> |
| ... | ...@@ -162,7 +160,9 @@ | |
| 162 | 160 | {ok, TimeStamp, Status}; |
| 163 | 161 | _ -> |
| 164 | 162 | not_found |
| 165 | end | |
| 163 | end; | |
| 164 | _ -> | |
| 165 | not_found | |
| 166 | 166 | end. |
| 167 | 167 | |
| 168 | 168 | remove_user(User, Server) -> |
| ... | ...@@ -3,6 +3,8 @@ | |
| 3 | 3 | * src/mod_privacy_odbc.erl: Prevent case_clause error when |
| 4 | 4 | ejabber_odbc:sql_query returns {error, Reason} |
| 5 | 5 | * src/mod_vcard_odbc.erl: Likewise |
| 6 | * src/mod_last_odbc.erl: Likewise | |
| 7 | * src/mod_offline_odbc.erl: Likewise | |
| 6 | 8 | |
| 7 | 9 | 2008-08-25 Badlop <badlop@process-one.net> |
| 8 | 10 |