From 68b9bd69568ae63e10d822412bdd319b6f558dd0 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Thu, 10 Oct 2024 23:35:48 -0700 Subject: [PATCH] refactor(runfiles): improve @bazel/runfiles error messages --- packages/runfiles/runfiles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runfiles/runfiles.ts b/packages/runfiles/runfiles.ts index f59f19b944..9f716baa97 100644 --- a/packages/runfiles/runfiles.ts +++ b/packages/runfiles/runfiles.ts @@ -168,7 +168,7 @@ export class Runfiles { // If the repository mappings were loaded ensure the source repository is valid. if (!(sourceRepo in this.repoMappings)) { throw new Error( - `source repository ${sourceRepo} not found in repo mappings: ${JSON.stringify( + `source repository "${sourceRepo}" not found in repo mappings: ${JSON.stringify( this.repoMappings, null, 2, @@ -181,7 +181,7 @@ export class Runfiles { if (result) { return result; } - const e = new Error(`could not resolve module ${modulePath}`); + const e = new Error(`could not resolve module "${modulePath}" from repository "${sourceRepo}"`); (e as any).code = 'MODULE_NOT_FOUND'; throw e; }