Misc #11295
closed
Request for comments about error messages
Added by ko1 (Koichi Sasada) over 9 years ago.
Updated 19 days ago.
Description
(This is not a proposal, bug reports)
Ruby shows error messages when something wrong.
There are several proposals to extend error messages.
And some requests.
- Reverse backtrace and show error messages at the bottom (to avoid scroll up terminal)
- Translation error messages to other languages
If you have any idea, please tell us.
We can consider about Ruby's error message APIs to realize your ideas.
(I can't guarantee we can implement your ideas :p)
ko1@atdot.net wrote:
There are several proposals to extend error messages.
What performance and memory usage impact do these have?
I run many small scripts and already find startup times slow.
- Reverse backtrace and show error messages at the bottom (to avoid
scroll up terminal)
We should reduce stack size limit instead to avoid big backtraces ;)
Jokes aside, this may be confusing and break compatibility because of
existing tools which process backtraces (perhaps generic and not limited
to Ruby).
- Translation error messages to other languages
NACK. This makes searching for users with similar problems more
difficult and makes error messages difficult for maintainers to
decipher.
Thanks for starting this discussion!
And some requests.
- Reverse backtrace and show error messages at the bottom (to avoid scroll up terminal)
+1 for this. It's how Python displays backtraces. That's a good precedent to follow. I find that senior devs (like myself) and brand new developers (like my students) often have problems determining the exact error when seeing a backtrace. The current output isn't very user friendly: it makes the most common use case difficult, instead of making it easy: "A programmer wants to know what error responsible for the crash."
Koichi Sasada wrote:
If you have any idea, please tell us.
We can consider about Ruby's error message APIs to realize your ideas.
(I can't guarantee we can implement your ideas :p)
Again, thanks for posting this.
I believe that some small changes can make Ruby error messages more helpful. E.g., I've just begun working on a Pull Request to change the rb_eArgError messages from e.g. "2 for 3" to "2 were expected, but 3 were given." Or even, "2 were expected, but 3 were given: <arg1.class>, <arg2.class>, <arg3.class>."
This change would greatly increase the usefulness and friendlyness of the interpreter, for relatively little work.
- Status changed from Open to Closed
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0