@distilled.cloud/resend 1.0.0-rc.18 → 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,7 @@
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
+ import type { SdkError } from "@distilled.cloud/core/sdk-error";
4
5
  /**
5
6
  * ResendProtocol -- hand-written.
6
7
  *
@@ -37,7 +38,8 @@ export type ResendOpError =
37
38
  | ConfigError
38
39
  | HttpClientError.HttpClientError
39
40
  | ResendParseError
40
- | InvalidInput;
41
+ | InvalidInput
42
+ | SdkError;
41
43
 
42
44
  /** Context (requirements) shared by every generated Resend operation. */
43
45
  export type ResendOpContext = Credentials | HttpClient.HttpClient;
@@ -62,11 +64,6 @@ export const ResendProtocol: Layer.Layer<API.Protocol> = /*@__PURE__*/ makeRestP
62
64
  if (code === undefined && message === undefined) return undefined;
63
65
  return { code, message };
64
66
  },
65
- unknownError: ({ code, message, body }) =>
66
- new UnknownResendError({
67
- code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
68
- message,
69
- body,
70
- }),
67
+ unknownError: (info) => new UnknownResendError(unknownErrorProps(info)),
71
68
  parseError: ({ body, cause }) => new ResendParseError({ body, cause }),
72
69
  });