@distilled.cloud/vanta 1.0.0-rc.19 → 1.0.0-rc.20

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/src/protocol.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type * as API from "@distilled.cloud/core/api";
2
2
  import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
3
- import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
3
+ import { makeRestProtocol, unknownErrorProps } from "@distilled.cloud/core/protocol-rest";
4
4
  import type { SdkError } from "@distilled.cloud/core/sdk-error";
5
5
  /**
6
6
  * VantaProtocol -- hand-written.
@@ -53,11 +53,6 @@ export const VantaProtocol: Layer.Layer<API.Protocol> = /*@__PURE__*/ makeRestPr
53
53
  }),
54
54
  // Vanta's error body is `{ code?: string, message?: string }` -- the
55
55
  // factory's default lenient envelope covers it.
56
- unknownError: ({ code, message, body }) =>
57
- new UnknownVantaError({
58
- code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
59
- message,
60
- body,
61
- }),
56
+ unknownError: (info) => new UnknownVantaError(unknownErrorProps(info)),
62
57
  parseError: ({ body, cause }) => new VantaParseError({ body, cause }),
63
58
  });