File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ import util from "node:util" ;
2
+
1
3
import {
2
4
HardhatError ,
3
5
HardhatPluginError ,
@@ -84,7 +86,7 @@ export function printErrorMessages(
84
86
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions
85
87
-- As we don't know the type of error we are printing, we can't know if it
86
88
has a `stack` property or not, so we print it as a string. */
87
- print ( error instanceof Error ? `${ error . stack } ` : `${ error } ` ) ;
89
+ print ( error instanceof Error ? `${ error . stack } ` : `${ util . inspect ( error ) } ` ) ;
88
90
if ( postErrorStackTraceMessage !== undefined ) {
89
91
print ( "" ) ;
90
92
print ( postErrorStackTraceMessage ) ;
Original file line number Diff line number Diff line change 1
1
import assert from "node:assert/strict" ;
2
2
import { beforeEach , describe , it } from "node:test" ;
3
+ import util from "node:util" ;
3
4
4
5
import {
5
6
HardhatError ,
@@ -278,7 +279,7 @@ describe("error-handler", () => {
278
279
assert . equal ( lines . length , 5 ) ;
279
280
assert . equal ( lines [ 0 ] , chalk . red . bold ( `An unexpected error occurred:` ) ) ;
280
281
assert . equal ( lines [ 1 ] , "" ) ;
281
- assert . equal ( lines [ 2 ] , `${ error } ` ) ;
282
+ assert . equal ( lines [ 2 ] , `${ util . inspect ( error ) } ` ) ;
282
283
assert . equal ( lines [ 3 ] , "" ) ;
283
284
assert . equal (
284
285
lines [ 4 ] ,
You can’t perform that action at this time.
0 commit comments