[Proposal] Enhance ArgumentErrors from ets in Exeption.blame

32 views
Skip to first unread message

Michał Muskała

unread,
Sep 11, 2017, 8:18:20 AM9/11/17
to elixir-l...@googlegroups.com
Hello everybody,

After watching José's keynote, I had an idea about extending Exception.blame to enhance even more exceptions. A great candidate is :ets. Most of the functions raise badarg for different exceptions. The primary issues once can recognise are:

- table is private/protected and other process tries to read/write it
- the arguments are actually bad
- wrong type of table for the operation
- value is not present in the table (in lookup_element)
and more.

It's possible to detect a lot of these conditions more precisely using the stack trace, arguments and some calls to :ets.info/2.

As a first step, I think detecting table being private/protected would be the easiest one and give the most value.

What do you think about this?

Michał.

José Valim

unread,
Sep 11, 2017, 8:20:53 AM9/11/17
to elixir-l...@googlegroups.com
If we can detect those confidence, it sounds like a good one to me.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/003ef9cd-3c9e-41ff-aacb-b57c1a35c858%40Spark.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages