Skip to content

Commit

Permalink
chore(astro): move error-map (#10898)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre committed Apr 29, 2024
1 parent b6f011d commit 87b31fb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/astro/src/content/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from './consts.js';
export { errorMap } from './error-map.js';
export { attachContentServerListeners } from './server-listeners.js';
export { createContentTypesGenerator } from './types-generator.js';
export {
Expand Down
5 changes: 1 addition & 4 deletions packages/astro/src/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ import type {
ContentEntryType,
DataEntryType,
} from '../@types/astro.js';
import { AstroError, AstroErrorData } from '../core/errors/index.js';

import { MarkdownError } from '../core/errors/index.js';
import { AstroError, AstroErrorData, MarkdownError, errorMap } from '../core/errors/index.js';
import { isYAMLException } from '../core/errors/utils.js';
import { CONTENT_FLAGS, CONTENT_TYPES_FILE, PROPAGATED_ASSET_FLAG } from './consts.js';
import { errorMap } from './error-map.js';
import { createImage } from './runtime-assets.js';

/**
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/core/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export {
export type { ErrorLocation, ErrorWithMetadata } from './errors.js';
export { codeFrame } from './printer.js';
export { createSafeError, positionAt } from './utils.js';
export { errorMap } from './zod-error-map.js';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { errorMap } from '../../../dist/content/index.js';
import { z } from '../../../zod.mjs';
import { fixLineEndings } from '../../test-utils.js';
import { errorMap } from '../dist/core/errors/zod-error-map.js';
import { z } from '../zod.mjs';
import { fixLineEndings } from './test-utils.js';

describe('Content Collections - error map', () => {
it('Prefixes messages with object key', () => {
Expand Down

0 comments on commit 87b31fb

Please sign in to comment.