Skip to content

fix: improve error message for wrongly formatted history files#1248

Open
Bhavysinghal wants to merge 1 commit into
OpenTermsArchive:mainfrom
Bhavysinghal:fix/history-file-format-error-message
Open

fix: improve error message for wrongly formatted history files#1248
Bhavysinghal wants to merge 1 commit into
OpenTermsArchive:mainfrom
Bhavysinghal:fix/history-file-format-error-message

Conversation

@Bhavysinghal

Copy link
Copy Markdown

Fixes #1184

What this does

When a history file is formatted incorrectly (using {} object instead
of [] array), the engine previously threw a confusing error:
"serviceHistory(termsType) push is not a function"

This change adds a validation check that throws a clear, human-readable
error message instead, telling the contributor exactly what is wrong and
how to fix it.

Why

As reported in issue #1184, this confusing error message caused confusion
for contributors. A clear error message will help future contributors
immediately understand and fix their mistake.

@MattiSG

MattiSG commented Jun 8, 2026

Copy link
Copy Markdown
Member

Hi @Bhavysinghal and thank you for this contribution!
We will take the time to make a full review whenever possible. In the meantime, I have done a quick review and confirmed there is no risk in running tests. The automated tests will now run. In order to proceed with the content review, please make sure to address any issues spotted by our bots 🙂

@Bhavysinghal Bhavysinghal force-pushed the fix/history-file-format-error-message branch from 8bb29a5 to 9db1386 Compare June 9, 2026 08:32
@Bhavysinghal

Copy link
Copy Markdown
Author

Hi @MattiSG! I've addressed the bot issues:

  • Fixed the commit message to follow the project's commitlint rules (sentence-case, no type prefix, under 50 characters)
  • Added an entry to CHANGELOG.md under the ## Unreleased section

The remaining test failures appear to be pre-existing CI infrastructure issues related to Puppeteer/Chrome not being available in the CI environment, and seem unrelated to this change. Please let me know if anything else needs to be addressed!

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.

Confusing error message with wrongly formatted history files

2 participants