MCPcopy
hub / github.com/vuejs/core / onError

Function onError

packages/vue-compat/src/index.ts:79–91  ·  view source on GitHub ↗
(err: CompilerError, asWarning = false)

Source from the content-addressed store, hash-verified

77 )
78
79 function onError(err: CompilerError, asWarning = false) {
80 const message = asWarning
81 ? err.message
82 : `Template compilation error: ${err.message}`
83 const codeFrame =
84 err.loc &&
85 generateCodeFrame(
86 template as string,
87 err.loc.start.offset,
88 err.loc.end.offset,
89 )
90 warn(codeFrame ? `${message}\n${codeFrame}` : message)
91 }
92
93 // The wildcard import results in a huge object with every export
94 // with keys that cannot be mangled, and can be quite heavy size-wise.

Callers 1

compileToFunctionFunction · 0.70

Calls 2

generateCodeFrameFunction · 0.90
warnFunction · 0.50

Tested by

no test coverage detected