https://pantsbuild.org/ logo
#general
Title
# general
a

aloof-angle-91616

01/29/2020, 7:07 AM
this issue has a few thoughts about whether any utilities for constructing rich/colorful error messages might be useful. it refers to the v2 engine stacktrace as one use case, but if anyone has seen any libraries or tools that have nice error messages, i'd love to draw from any relevant inspiration -- rustc is a great example, they have a cute little framework for formatting compile errors which is mainly why i think an
errutil.py
would ever make sense for pants. https://github.com/pantsbuild/pants/issues/9033
i'm thinking that "displaying error messages" => "do not need to be written to the output stream with extreme speed" since they generally occur right before pants exits. so the choice of python is ok for now (as opposed to rust where we try to put all the hot code).
we already have
pants.base.deprecated
(which i love and is the first thing that made me love the pants codebase) which has very neat message formatting utils including an option to control which stack frame is shown in the message. https://github.com/pantsbuild/pants/blob/master/src/python/pants/base/deprecated.py
just some thoughts! any pants user (or just computer user) is welcome to comment here or on the ticket!
3 Views