diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2010-08-06 12:13:55 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-08-06 12:13:55 +0100 |
commit | 2da241c04ed395a4506377bf4f1769b890227cc6 (patch) | |
tree | 24efbf7e6d2d1c4f68382baae2422c7f0b925ef2 | |
parent | eadcf1446a5cac40b146e6b17f54c397a3b97804 (diff) | |
download | rabbitmq-server-2da241c04ed395a4506377bf4f1769b890227cc6.tar.gz |
don't depend on exceptions
-rw-r--r-- | src/rabbit_mnesia.erl | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 6470dc0a..dbb270a1 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -234,21 +234,23 @@ ensure_mnesia_not_running() -> check_schema_integrity() -> TabDefs = table_definitions(), - try - [Failure || Tab <- table_names(), - begin - {_, TabDef} = proplists:lookup(Tab, TabDefs), - {_, ExpAttrs} = proplists:lookup(attributes, TabDef), - Attrs = mnesia:table_info(Tab, attributes), - Failure = {table_attributes_mismatch, Tab, ExpAttrs, Attrs}, - Attrs /= ExpAttrs - end] - of + Tables = mnesia:system_info(tables), + case [Failure || Tab <- table_names(), + begin + {_, TabDef} = proplists:lookup(Tab, TabDefs), + {_, ExpAttrs} = proplists:lookup(attributes, TabDef), + case lists:member(Tab, Tables) of + false -> Failure = {table_missing, Tab}, + true; + true -> Attrs = mnesia:table_info( + Tab, attributes), + Failure = {table_attributes_mismatch, Tab, + ExpAttrs, Attrs}, + Attrs /= ExpAttrs + end + end] of [] -> ok; Ps -> {error, Ps} - catch - exit:Reason -> - {error, Reason} end. %% The cluster node config file contains some or all of the disk nodes |