Skip to main content

marque_core/
error.rs

1// SPDX-FileCopyrightText: 2026 Knitli Inc.
2//
3// SPDX-License-Identifier: LicenseRef-MarqueLicense-1.0
4
5use marque_ism::Span;
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum CoreError {
10    #[error("malformed marking: {0:?}")]
11    MalformedMarking(String),
12
13    #[error("unrecognized token at offset {offset}: {token:?}")]
14    UnrecognizedToken { token: String, offset: usize },
15
16    #[error("invalid UTF-8 in span {0:?}")]
17    InvalidUtf8(Span),
18
19    #[error("empty source buffer")]
20    EmptySource,
21}