MCPcopy Index your code
hub / github.com/nodejs/node / getErrorSourceExpression

Function getErrorSourceExpression

lib/internal/errors/error_source.js:153–160  ·  view source on GitHub ↗

* Get the source expression of an error. If source map is enabled, resolve the source location * based on the source map. * * The `error.stack` must not have been accessed, or the source location may be incorrect. The * resolution is based on the structured error stack data. * @param {Error|obj

(error)

Source from the content-addressed store, hash-verified

151 * @returns {string|undefined}
152 */
153function getErrorSourceExpression(error) {
154 const loc = getErrorSourceLocation(error);
155 if (loc === undefined) {
156 return;
157 }
158 const { sourceLine, startColumn } = loc;
159 return getFirstExpression(sourceLine, startColumn);
160}
161
162module.exports = {
163 getErrorSourceLocation,

Callers 1

getErrMessageFunction · 0.85

Calls 2

getErrorSourceLocationFunction · 0.85
getFirstExpressionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…