Skip to main content
Log in

Mojo function

format_error

format_error[*Ts: Writable](graph: Optional[Graph], *messages: *Ts, *, location: Optional[_SourceLocation] = Optional(None)) -> String

Formats an error string that includes call information.

Parameters:

  • *Ts (Writable): The message types.

Args:

  • graph (Optional[Graph]): The graph for context information.
  • *messages (*Ts): Error messages to raise.
  • location (Optional[_SourceLocation]): An optional location for a more specific error message.

Returns:

The string for an error message augmented with call context information.

format_error[*Ts: Writable](graph: Optional[Graph], messages: VariadicPack[origin, Writable, Ts], location: Optional[_SourceLocation] = Optional(None)) -> String

Formats an error string that includes call information.

Parameters:

  • *Ts (Writable): The message types.

Args:

  • graph (Optional[Graph]): The graph for context information.
  • messages (VariadicPack[origin, Writable, Ts]): Error messages to raise.
  • location (Optional[_SourceLocation]): An optional location for a more specific error message.

Returns:

The string for an error message augmented with call context information.