Skip to content

Commit d3c901f

Browse files
committed
simplify cause reporting
1 parent a89028b commit d3c901f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/esbuild/lib/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,9 @@ function vfileMessageToEsbuild(state, message) {
199199
location.length = Math.min(location.length, maxLength)
200200
}
201201

202-
/** @type {Error} */
203-
let exc = message
204202
let text = message.reason
205-
while (exc.cause instanceof Error) {
206-
exc = exc.cause
207-
text = `${text}:\n ${exc}`
203+
if (message.cause) {
204+
text = `${text}:\n ${message.cause}`
208205
}
209206

210207
return {

0 commit comments

Comments
 (0)