diff --git a/src/garden.ts b/src/garden.ts index ede78fa..eb3d318 100644 --- a/src/garden.ts +++ b/src/garden.ts @@ -170,7 +170,7 @@ export class Garden { seedPacket.parse(packet); const expandedPacket = expandSeedPacket(packet); //This will throw if there are errors in the packet. - const warnings = verifySeedPacket(expandedPacket); + const warnings = verifySeedPacket(location, expandedPacket); if (!this._location) this._location = location; for (const [id, seed] of Object.entries(expandedPacket.seeds)) { const ref : AbsoluteSeedReference = { diff --git a/src/seed.ts b/src/seed.ts index 04b2e89..5f679f1 100644 --- a/src/seed.ts +++ b/src/seed.ts @@ -228,7 +228,7 @@ const collectSeedReferences = (data : ExpandedSeedData) : SeedReference[] => { //Will throw an error if an error is found. Will return an array of errors //representing warnings for less significant problems. -export const verifySeedPacket = (packet : ExpandedSeedPacket) : Error[] | null => { +export const verifySeedPacket = (location: SeedPacketAbsoluteLocation, packet : ExpandedSeedPacket) : Error[] | null => { const warnings : Error[] = []; //First sanity check we typecheck, throwing if not. seedPacket.parse(packet); @@ -240,7 +240,7 @@ export const verifySeedPacket = (packet : ExpandedSeedPacket) : Error[] | null = if (!packet.seeds[ref.seed]) throw new Error(`Seed ${id} referenced a non-existent local seed: ${ref.seed}`); } } - if (!packet.environment || !packet.environment.namespace) warnings.push(new Error('namespace is not set. Setting a namespace is recommended')); + if (!packet.environment || !packet.environment.namespace) warnings.push(new Error(`namespace is not set in ${location}. Setting a namespace is recommended`)); return warnings.length ? warnings : null; };