NetLogo / NetLogo/Table-Extension
Enhancement: include table name in error message
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
REQUEST: include the name of the table when throwing an extension runtime error
I am a big fan of tables and use them heavily in my code.
When I try to access non-existent key in a table with table:get, the resulting error message tells me the name of the key I am trying to access, but not the name of the table. Here is an example of a recent error:
Extension exception: No value for Fashion1 in table.
error while observer running TABLE:GET
called by ....
However, this particular call came from inside a very long procedure that is passed as an anonymous command through a foreach, and the key ("Fashion1") is inside a variable which itself came from another table. The procedure has more than a dozen "table:get" statements including some nested tables. As a result, the error message does not help me pinpoint the line where the error is occurring. It just took me a good 30 minutes of setting break points to figure out where the error was being generated. This has now happened a few times - often the offending procedure is shorter and I have been able to figure it out more quickly, but occasionally it has been very painful.
It would be awesome if in this and other error messages you could also print out the name of the table, to spare us the time of having to figure it out.
Thank you.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the Table-Extension Java sources for the existing “No value for ... in table” runtime error and trace the table:get path that constructs it. Confirm how table instances expose their names, then verify the resulting error identifies both the missing key and the relevant table without changing the existing error context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100