@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
29 lines • 984 B
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { IamClientError } from "./iamclienterror.js";
import { formatZodError } from "./sdkvalidationerror.js";
export class ResponseValidationError extends IamClientError {
constructor(message, extra) {
super(message, extra);
this.name = "ResponseValidationError";
this.cause = extra.cause;
this.rawValue = extra.rawValue;
this.rawMessage = extra.rawMessage;
}
/**
* Return a pretty-formatted error message if the underlying validation error
* is a ZodError or some other recognized error type, otherwise return the
* default error message.
*/
pretty() {
if (this.cause instanceof z.ZodError) {
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
}
else {
return this.toString();
}
}
}
//# sourceMappingURL=responsevalidationerror.js.map