cdk-real-drift 0.4.28 → 0.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -10148,8 +10148,10 @@ async function loadBaseline(stackName, accountId, region) {
10148
10148
  let parsed;
10149
10149
  try {
10150
10150
  parsed = JSON.parse(raw);
10151
- } catch {
10152
- throw new Error(`baseline file ${path} is not valid JSON (corrupt or partially written)`);
10151
+ } catch (e) {
10152
+ const detail = e.message;
10153
+ const conflict = /^(<{7}|={7}|>{7})/m.test(raw) ? " — looks like an unresolved git merge conflict (resolve the <<<<<<< / ======= / >>>>>>> markers)" : "";
10154
+ throw new Error(`baseline file ${path} is not valid JSON (corrupt or partially written): ${detail}${conflict} (delete or \`git restore\` the file to reset, then re-run \`cdkrd record\`)`);
10153
10155
  }
10154
10156
  if (parsed === null || typeof parsed !== "object") throw new Error(`baseline file ${path} is malformed: root is not an object`);
10155
10157
  if (parsed.stackName && parsed.stackName !== stackName) throw new Error(`baseline file ${path} was captured for stack ${parsed.stackName}, but it was loaded as stack ${stackName} (the file was likely copied or renamed to the wrong path, or a case-insensitive filesystem collided two stacks onto one file). Baselines are per-stack — run \`cdkrd record\` to write this stack's own baseline file, or restore the correct file from git.`);