Skip to content

ParseError

Mojo struct 🡭

@memory_only
struct ParseError

Error raised during FASTQ parsing with contextual information.

  • message (String)
  • record_number (Int)
  • line_number (Int)
  • file_position (Int64)
  • record_snippet (String)

AnyType, ImplicitlyDestructible, Writable

def __init__(out self, message: String, record_number: Int = 0, line_number: Int = 0, file_position: Int64 = 0, record_snippet: String = "")

Initialize ParseError with message and optional context.

Args:

  • message (String): The error message.
  • record_number (Int): 1-indexed record number where error occurred (0 if unknown).
  • line_number (Int): 1-indexed line number in file (0 if unknown).
  • file_position (Int64): Byte position in file (0 if unknown).
  • record_snippet (String): First 100-200 chars of problematic record (empty if unavailable).
  • self (Self)

Returns:

Self

def write_to[w: Writer](self, mut writer: w)

Write error to writer without building an intermediate String.

Parameters:

  • w (Writer)

Args:

  • self (Self)
  • writer (w)