Home / Class/ ActionInputError Class — astro Architecture

ActionInputError Class — astro Architecture

Architecture documentation for the ActionInputError class in client.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4504796a_5913_23cb_44e2_1c4f7195959f["ActionInputError"]
  eb04bc4a_f415_2ce3_c34b_e7ef77fb812f["client.ts"]
  4504796a_5913_23cb_44e2_1c4f7195959f -->|defined in| eb04bc4a_f415_2ce3_c34b_e7ef77fb812f
  2b53efcf_51d5_1fb6_63d8_a6dc49d2552b["constructor()"]
  4504796a_5913_23cb_44e2_1c4f7195959f -->|method| 2b53efcf_51d5_1fb6_63d8_a6dc49d2552b

Relationship Graph

Source Code

packages/astro/src/actions/runtime/client.ts lines 128–153

export class ActionInputError<T extends ErrorInferenceObject> extends ActionError {
	type = 'AstroActionInputError';

	// We don't expose all ZodError properties.
	// Not all properties will serialize from server to client,
	// and we don't want to import the full ZodError object into the client.

	issues: z.$ZodIssue[];
	fields: { [P in keyof T]?: string[] | undefined };

	constructor(issues: z.$ZodIssue[]) {
		super({
			message: `Failed to validate: ${JSON.stringify(issues, null, 2)}`,
			code: 'BAD_REQUEST',
		});
		this.issues = issues;
		this.fields = {};
		for (const issue of issues) {
			if (issue.path.length > 0) {
				const key = issue.path[0].toString() as keyof typeof this.fields;
				this.fields[key] ??= [];
				this.fields[key]?.push(issue.message);
			}
		}
	}
}

Domain

Frequently Asked Questions

What is the ActionInputError class?
ActionInputError is a class in the astro codebase, defined in packages/astro/src/actions/runtime/client.ts.
Where is ActionInputError defined?
ActionInputError is defined in packages/astro/src/actions/runtime/client.ts at line 128.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free