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

Function onError

packages/vue/src/index.ts:76–88  ·  view source on GitHub ↗
(err: CompilerError, asWarning = false)

Source from the content-addressed store, hash-verified

74 const { code } = compile(template, opts)
75
76 function onError(err: CompilerError, asWarning = false) {
77 const message = asWarning
78 ? err.message
79 : `Template compilation error: ${err.message}`
80 const codeFrame =
81 err.loc &&
82 generateCodeFrame(
83 template as string,
84 err.loc.start.offset,
85 err.loc.end.offset,
86 )
87 warn(codeFrame ? `${message}\n${codeFrame}` : message)
88 }
89
90 // The wildcard import results in a huge object with every export
91 // 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