You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow automatic shortening of error messages. Could be implemented similarly to frame suppression. A shortened message would keep only, for example, 3 lines, and the number of lines could be controlled similarly to max_frames in Traceback
What problem does it solve for you?
Chained exceptions can get quite long in frameworks that build on top of several other codebases. The error messages in some of the exceptions in the chain can be almost certainly always useless. Shortening them would make debugging way simpler.
In my framework, I would by default have certain modules' error messages shortened/supressed automatically, unless the debug mode is activated.
For example, the RuntimeError here:
Would become this if max_error_lines=3 (or whatever the name would be):
RuntimeError: Failed to instantiate component 'lighter.utils.model.adjust_prefix_and_load_state_dict' with kwargs: {'ckpt_to_model_prefix':
{'_orig_mod.': ''}, 'ckpt_path': '/mnt/ssd1/rogueone/ibro/CT_FM/ct_fm_nsclc/checkpoints_8_Jan_2024/random_init_100/epoch=152-step=6579.ckpt',
'model': SegResNetDS(
...
Alternative
Please let me know if there is already a way to achieve this. Also, if this is something that you would indeed like to have, feel free to briefly instruct me in how it could be achieved and I would be happy to try to make a pull request.
The text was updated successfully, but these errors were encountered:
or, alternatively, add an option to just shorten the error messages of the already suppressed modules. That won't be as complex and will probably be just enough amount of control -- in my case, that would actually be perfect.
How would you improve Rich?
Allow automatic shortening of error messages. Could be implemented similarly to frame suppression. A shortened message would keep only, for example, 3 lines, and the number of lines could be controlled similarly to
max_frames
inTraceback
What problem does it solve for you?
Chained exceptions can get quite long in frameworks that build on top of several other codebases. The error messages in some of the exceptions in the chain can be almost certainly always useless. Shortening them would make debugging way simpler.
In my framework, I would by default have certain modules' error messages shortened/supressed automatically, unless the debug mode is activated.
For example, the RuntimeError here:
Would become this if
max_error_lines=3
(or whatever the name would be):Alternative
Please let me know if there is already a way to achieve this. Also, if this is something that you would indeed like to have, feel free to briefly instruct me in how it could be achieved and I would be happy to try to make a pull request.
The text was updated successfully, but these errors were encountered: