summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-08-06 12:13:55 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-08-06 12:13:55 +0100
commit314b2a80bd83fe1a03ed6dbb5f9a4c6d3a2f5be4 (patch)
tree24efbf7e6d2d1c4f68382baae2422c7f0b925ef2
parentcfb4ced43a8f02a3ca5518cafde9f44372048128 (diff)
downloadrabbitmq-server-git-314b2a80bd83fe1a03ed6dbb5f9a4c6d3a2f5be4.tar.gz
don't depend on exceptions
-rw-r--r--src/rabbit_mnesia.erl28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 6470dc0ac0..dbb270a1fa 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