@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
37 lines • 1.13 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { formatZodError } from "./sdkvalidationerror.js";
import { VercelError } from "./vercelerror.js";
export class ResponseValidationError extends VercelError {
/**
* The raw value that failed validation.
*/
rawValue;
/**
* The raw message that failed validation.
*/
rawMessage;
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