Files
klz-cables.com/.pnpm-store/v10/files/00/c9c19e3c1244175e16eb9e35f433afb82ed7312c20f00a84541f7d384bb69386512bb8d59a2a67c52feeda34386f74f63bd290bb0874293a988c3471cecf07
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

41 lines
1.1 KiB
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.locatedError = locatedError;
var _toError = require('../jsutils/toError.js');
var _GraphQLError = require('./GraphQLError.js');
/**
* Given an arbitrary value, presumably thrown while attempting to execute a
* GraphQL operation, produce a new GraphQLError aware of the location in the
* document responsible for the original Error.
*/
function locatedError(rawOriginalError, nodes, path) {
var _nodes;
const originalError = (0, _toError.toError)(rawOriginalError); // Note: this uses a brand-check to support GraphQL errors originating from other contexts.
if (isLocatedGraphQLError(originalError)) {
return originalError;
}
return new _GraphQLError.GraphQLError(originalError.message, {
nodes:
(_nodes = originalError.nodes) !== null && _nodes !== void 0
? _nodes
: nodes,
source: originalError.source,
positions: originalError.positions,
path,
originalError,
});
}
function isLocatedGraphQLError(error) {
return Array.isArray(error.path);
}