One way to handle this is
Try creating a table using mnesia:create_table(Table_name, ...)
If the table already exists (1), it will return {aborted, {already_exists, Table_name}}
If the table does not exit, it will be created and {atomic,ok} will be if successful
If an error is created in the table in (3), {aborted, Reason} will be returned.
Process each of these return values โโas necessary.
source share