-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: mark cwd grey while inspecting errors #41082
Conversation
Is grey currently only used for stack trace lines that point to node internals? If so, perhaps we should use a different color for cwd to avoid confusion? |
Yes, currently only node internal stack frames are grey. It was meant as "this is probably not important" (no matter what it represented), focus on the rest.
Do you have a concrete suggestion? I fear using colors would actually highlight the cwd instead of moving it to the background. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if it would be better to use the directory containing the first package.json
instead. The cwd
is not necessarily where the code is (even though it probably is most of the time).
This would require |
I totally get that, and I don't object to using the working directory. I just thought we are probably reading the |
@tniessen I just tried to figure out how to implement something like that and could not think of a good way to do so. We do not always have a |
@BridgeAR That does make it difficult, you are right. I am not too worried about using cwd, we can probably change the exact conditions later without breaking anything (if we ever want to). We could, maybe, determine a prefix of all loaded JS modules, but that seems out of scope here, and I am not even sure if that would be reliable. |
@tniessen I agree, we can definitely improve the implementation later. Are you fine with the change as is in general? |
It seems reasonable to me. The only super tiny nit I have is that, personally, I believe that the first |
73bcb9f
to
046887d
Compare
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
c0f4ca9
to
4328ee3
Compare
Landed in 2fe4e94...7cfd5f1 |
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: nodejs/node#41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: nodejs/node#41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack
traces contain the current working directory in their trace.
If that's the case, the cwd part is marked grey to focus on the
rest of the path.
Old:
New:
Signed-off-by: Ruben Bridgewater ruben@bridgewater.de