Skip to content

fix: include error message context in load failure logs#8743

Merged
mvaligursky merged 1 commit into
mainfrom
mv-error-context-logging
May 18, 2026
Merged

fix: include error message context in load failure logs#8743
mvaligursky merged 1 commit into
mainfrom
mv-error-context-logging

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

External error reporters (e.g. Poki) typically capture console.error arguments via JSON.stringify. Error objects have non-enumerable message/stack properties, so passing a raw Error as the only argument serializes to {}, producing dashboard entries like console.error: [{}] with no actionable context.

This patches the three engine call sites that logged raw errors to also include a string-form summary, while still passing the original Error as a secondary argument so it remains expandable in dev tools.

Changes:

  • ResourceLoader._onFailure: log the resource key plus err.message
  • I18n.addData / I18n.removeData: log the method name plus err.message
  • AssetRegistry._loadTextures (material texture loader): log the material asset name plus err.message

API Changes:

  • None. Only the message format passed to console.error changed.

External error reporters typically serialize console.error arguments via
JSON.stringify. Error objects have non-enumerable message/stack
properties, so a raw Error as the sole argument serializes to {},
producing reports with no actionable context.

Update ResourceLoader._onFailure, I18n.addData/removeData and
AssetRegistry material texture loader to also log a string-form summary
(including err.message and the relevant key/name) while still passing
the original Error for dev tools.
@mvaligursky mvaligursky self-assigned this May 18, 2026
@mvaligursky mvaligursky merged commit e2edc5e into main May 18, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-error-context-logging branch May 18, 2026 13:38
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.

1 participant