19972013 Ericsson AB. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Appendix A: Mnesia Error Messages Claes Wikström, Hans Nilsson and Håkan Mattsson Bjarne Däcker Bjarne Däcker Bjarne Däcker 96-11-20 B Mnesia_App_A.xml

Whenever an operation returns an error in Mnesia, a description of the error is available. For example, the functions mnesia:transaction(Fun), or mnesia:create_table(N,L) may return the tuple {aborted, Reason}, where Reason is a term describing the error. The following function is used to retrieve more detailed information about the error:

mnesia:error_description(Error)
Errors in Mnesia

The following is a list of valid errors in Mnesia.

badarg. Bad or invalid argument, possibly bad type. no_transaction. Operation not allowed outside transactions. combine_error. Table options were illegally combined. bad_index. Index already exists, or was out of bounds. already_exists. Schema option to be activated is already on. index_exists. Some operations cannot be performed on tables with an index. no_exists.; Tried to perform operation on non-existing (non-alive) item. system_limit.; A system limit was exhausted. mnesia_down. A transaction involves records on a remote node which became unavailable before the transaction was completed. Record(s) are no longer available elsewhere in the network. not_a_db_node. A node was mentioned which does not exist in the schema. bad_type.; Bad type specified in argument. node_not_running. Node is not running. truncated_binary_file. Truncated binary in file. active. Some delete operations require that all active records are removed. illegal. Operation not supported on this record.

The following example illustrates a function which returns an error, and the method to retrieve more detailed error information.

The function mnesia:create_table(bar, [{attributes, 3.14}]) will return the tuple {aborted,Reason}, where Reason is the tuple {bad_type,bar,3.14000}.

The function mnesia:error_description(Reason), returns the term {"Bad type on some provided arguments",bar,3.14000} which is an error description suitable for display.