Skip to content

Fix silent content import failures when author validation fails#28156

Open
jameslcowan wants to merge 10000 commits into
TryGhost:mainfrom
jameslcowan:fix/importer-validation-errors
Open

Fix silent content import failures when author validation fails#28156
jameslcowan wants to merge 10000 commits into
TryGhost:mainfrom
jameslcowan:fix/importer-validation-errors

Conversation

@jameslcowan
Copy link
Copy Markdown

@jameslcowan jameslcowan commented May 26, 2026

Fixes #26268

When a JSON import hits validation errors (bad email, bio too long, etc.), the data importer was throwing a raw array instead of a proper error. Node logs that as rejected with a non-error: [object Array], and the failure email just says to contact support — no hint which author or field failed.

This wraps those errors in a DataImportError with readable messages (including the user email when we have it from import context) and shows those details in the import failure email.

Test plan

  • pnpm test in ghost/core (or at least import-errors.test.js)
  • Import a JSON export with an invalid users[].email — expect a clear error, not [object Array]
  • Import with a bio over 250 chars — same

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importer failures are silent