ValidationError
Mojo struct 🡭
ValidationError
Section titled “ValidationError”@memory_onlystruct ValidationErrorError raised during FASTQ record validation.
Fields
Section titled “Fields”- message (
String) - record_number (
Int) - field (
String) - record_snippet (
String)
Implemented traits
Section titled “Implemented traits”AnyType, ImplicitlyDestructible, Writable
Methods
Section titled “Methods”__init__
Section titled “__init__”def __init__(out self, message: String, record_number: Int = 0, field: String = "", record_snippet: String = "")Initialize ValidationError with message and optional context.
Args:
- message (
String): The error message. - record_number (
Int): 1-indexed record number where error occurred (0 if unknown). - field (
String): Field name where validation failed (e.g., “header”, “sequence”, “quality”). - record_snippet (
String): First 100-200 chars of problematic record (empty if unavailable). - self (
Self)
Returns:
Self
write_to
Section titled “write_to”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)