Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error messages #65

Closed
salseeg opened this issue Dec 30, 2022 · 1 comment · Fixed by #66
Closed

Better error messages #65

salseeg opened this issue Dec 30, 2022 · 1 comment · Fixed by #66

Comments

@salseeg
Copy link

salseeg commented Dec 30, 2022

Hi @lucaong
Thanks for CubDB, it is awesome on Nerves.

Here is what I get when hitting limit of FAT32 formatted usb drive.

2022-12-30 18:08:03.356000 [error] GenServer Chat.Db.MainDb.QueueWriter terminating
** (UndefinedFunctionError) function :efbig.exception/1 is undefined (module :efbig is not available)
    :efbig.exception([])
    (cubdb 2.0.1) lib/cubdb/store/file.ex:153: CubDB.Store.CubDB.Store.File.raise_if_error/1
    (cubdb 2.0.1) lib/cubdb/btree.ex:471: anonymous fn/2 in CubDB.Btree.store_nodes/2
    (elixir 1.14.1) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (cubdb 2.0.1) lib/cubdb/btree.ex:461: CubDB.Btree.build_up/6
    (cubdb 2.0.1) lib/cubdb/btree.ex:299: CubDB.Btree.insert_terminal_node/4
    (cubdb 2.0.1) lib/cubdb/transaction.ex:228: CubDB.Tx.put/3
    (chat 0.1.0) lib/chat/db/queue_writer.ex:136: anonymous fn/2 in Chat.Db.QueueWriter.db_write/2
Last message: {:"$gen_cast", {:write, [{{:file_chunk, "8f417917-4f7e-4e1d-9283-1ff9585d4999", 20971520, 31457279}, <<212, 108, 227, 95, 116, 106, 124, 96, 64, 180, 45, 210, 120, 69, 60, 72, 155, 253, 163, 152, 202, 21, 122, 2, 107, 16, 158, 142, 124, 191, 37, 122, 130, 57, 112, 4, 91, 40, 210, 77, 164, 214, 41, ...>>}]}}

This error message leads nowhere since :efbig module does not exist in Erlang.
It is actually a POSIX error returned by :file module.

Having it like {:file, :efbig} would be less misguiding 😉

@lucaong
Copy link
Owner

lucaong commented Dec 30, 2022

Hi @salseeg ,
very good point, I will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants