refactor(errors): error display function takes an input string to be able to resolve spans in the future
This commit is contained in:
parent
442c4b7beb
commit
4246775db5
3 changed files with 13 additions and 7 deletions
|
|
@ -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}")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue