anchor.diff:              {error, file_exists};
           false ->
               {Shards, Doc} = generate_shard_map(DbName, Options),
  -            case {create_shard_files(Shards), create_shard_db_doc(Doc)} of
  -            {ok, {ok, Status}} ->
  -                Status;
  -            {file_exists, {ok, _}} ->
  -                {error, file_exists};
  -            {_, Error} ->
  -                Error
  +            CreateShardResult = create_shard_files(Shards),
  +            case CreateShardResult of
  +            enametoolong ->
  +                {error, {database_name_too_long, DbName}};
  +            _ ->
  +                case {CreateShardResult, create_shard_db_doc(Doc)} of
  +                {ok, {ok, Status}} ->
  +                    Status;
  +                {file_exists, {ok, _}} ->
  +                    {error, file_exists};
  +                {_, Error} ->
  +                    Error
  +                end
               end
           end;
       Error ->
  
positive.code:     after
          rexi_monitor:stop(RexiMon)
      end.
  
  handle_message(file_exists, _, _) ->
      {error, file_exists};
  
negative.code:     try fabric_util:recv(Workers, #shard.ref, fun handle_message/3, Workers) of
      {error, file_exists} ->
          file_exists;
      {error, enametoolong} ->
          enametoolong;
      {timeout, DefunctWorkers} ->
          fabric_util:log_timeout(DefunctWorkers, "create_db"),
          {error, timeout};
  