Skip to content

engine: model diagnostics print the internal ModelError{...} wrapper #952

Closed

Description

@bpowers

Model-level diagnostics used to print the internal error struct, e.g. warning in model 'main': ModelError{conveyor_ltm_degraded: LTM ... is degraded: ...}.
They should read like the unit diagnostics: warning in model 'main': conveyor_ltm_degraded -- LTM ... is degraded: ....

On main they do.
format_diagnostic's model arm builds the message from the code and the reason (code_and_reason(code, diag.reason())), and Display for Error prints only the reason, so the ModelError{...} wrapper can no longer appear anywhere a whole Error is formatted.

Pointers

  • src/simlin-engine/src/errors.rs: the DiagnosticError::Model arms of format_diagnostic
  • src/simlin-engine/src/common.rs: impl fmt::Display for Error
  • src/diagram/tests/project-controller.test.ts: its mock already used the code -- reason form

Activity

  1. added
    engine
    bug
    on Oct 12, 2026
  2. changed the title [-]engine: model-level diagnostics leak the internal `ModelError{code: details}` Display form into user-facing messages[/-] [+]engine: model diagnostics print the internal ModelError{...} wrapper[/+] on Oct 12, 2026
  3. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    format_diagnostic's Model arms build the summary from code_and_reason(code, diag.reason()) (src/simlin-engine/src/errors.rs:297-304) and Display for Error prints only the reason (common.rs:1188-1192); no ModelError{ format string remains anywhere in the Rust sources. The code -- reason summary and bare-reason details are pinned per arm by errors.rs details_is_always_the_bare_reason.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions