primcli 1.36.0 → 1.37.0

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.
@@ -269,8 +269,11 @@ function readMailJson(path, maxBytes = 16384) {
269
269
  if (value === null) throw invalidSharedMail();
270
270
  return value;
271
271
  } catch (error) {
272
- if (error.code === "ENOENT") return null;
273
- throw invalidSharedMail();
272
+ const code = error.code;
273
+ if (code === "ENOENT") return null;
274
+ const invalid = invalidSharedMail();
275
+ if (typeof code === "string") invalid.cause = { code };
276
+ throw invalid;
274
277
  }
275
278
  }
276
279
  function writeMailJson(path, value) {