refactor(errors): error display function takes an input string to be able to resolve spans in the future

This commit is contained in:
Khaïs COLIN 2025-05-03 21:29:40 +02:00
parent 442c4b7beb
commit 4246775db5
3 changed files with 13 additions and 7 deletions

View file

@ -4,23 +4,23 @@ use crate::{
};
pub trait OSDBError {
fn display(&self, file: &str);
fn display(&self, file: &str, input: &str);
}
impl OSDBError for MetaCommandParseError {
fn display(&self, file: &str) {
fn display(&self, file: &str, _input: &str) {
println!("{file}: {self}")
}
}
impl OSDBError for StatementParseError {
fn display(&self, file: &str) {
fn display(&self, file: &str, _input: &str) {
println!("{file}: {self}")
}
}
impl OSDBError for CommandParseError {
fn display(&self, file: &str) {
fn display(&self, file: &str, _input: &str) {
println!("{file}: {self}")
}
}