diff --git a/bids-validator/src/files/inheritance.ts b/bids-validator/src/files/inheritance.ts index 5d3bebb4a..5297d39c3 100644 --- a/bids-validator/src/files/inheritance.ts +++ b/bids-validator/src/files/inheritance.ts @@ -33,10 +33,13 @@ export function* walkBack( exactMatch.viewed = true yield exactMatch } else { + // Sort candidates (in-place) and take first as the "location" of the problem + const location = candidates.sort()[0] throw { code: 'MULTIPLE_INHERITABLE_FILES', - location: source.path, - affects: candidates.map((file) => file.path), + location, + affects: source.path, + issueMessage: `Candidate files: ${candidates}`, } } } else if (candidates.length === 1) {