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ł.