MCPcopy
hub / github.com/vitest-dev/vitest / logError

Function logError

test/core/src/wasm/wasm-bindgen/index_bg.js:39–60  ·  view source on GitHub ↗
(f, args)

Source from the content-addressed store, hash-verified

37}
38
39function logError(f, args) {
40 try {
41 return f.apply(this, args)
42 }
43 catch (e) {
44 const error = (function () {
45 try {
46 return e instanceof Error
47 ? `${e.message}\n\nStack:\n${e.stack}`
48 : e.toString()
49 }
50 catch {
51 return '<failed to stringify thrown value>'
52 }
53 })()
54 console.error(
55 'wasm-bindgen: imported JS function that was not marked as `catch` threw an error:',
56 error,
57 )
58 throw e
59 }
60}
61
62let WASM_VECTOR_LEN = 0
63

Callers 1

Calls 2

errorMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected