MCPcopy Create free account
hub / github.com/Effect-TS/effect / InvalidRequestError

Class InvalidRequestError

packages/effect/src/unstable/ai/AiError.ts:587–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585 * @since 4.0.0
586 */
587export class InvalidRequestError extends Schema.Error<InvalidRequestError>(
588 "effect/ai/AiError/InvalidRequestError"
589)({
590 _tag: Schema.tag("InvalidRequestError"),
591 parameter: Schema.optional(Schema.String),
592 constraint: Schema.optional(Schema.String),
593 description: Schema.optional(Schema.String),
594 metadata: providerMetadataWithDefaults<InvalidRequestErrorMetadata>(),
595 http: Schema.optional(HttpContext)
596}) {
597 /**
598 * Marks `InvalidRequestError` as a semantic AI error reason for runtime guards.
599 *
600 * @since 4.0.0
601 */
602 readonly [ReasonTypeId] = ReasonTypeId
603
604 /**
605 * Invalid request errors require fixing the request and are not retryable.
606 *
607 * @since 4.0.0
608 */
609 get isRetryable(): boolean {
610 return false
611 }
612
613 override get message(): string {
614 let msg = "Invalid request"
615 if (this.parameter) msg += `: parameter '${this.parameter}'`
616 if (this.constraint) msg += ` ${this.constraint}`
617 if (this.description) msg += `. ${this.description}`
618 return msg
619 }
620}
621
622/**
623 * Error indicating the AI provider experienced an internal error.

Callers

nothing calls this directly

Calls 2

tagMethod · 0.65

Tested by

no test coverage detected