Skip to content

Commit

Permalink
feat: Implement Display for SQLFluffUserError
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero authored and benfdking committed Jan 12, 2025
1 parent 1fc8f2f commit 67f5a9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/lib-core/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Display;
use std::ops::{Deref, DerefMut, Range};

use fancy_regex::Regex;
Expand Down Expand Up @@ -149,6 +150,12 @@ impl SQLFluffUserError {
}
}

impl Display for SQLFluffUserError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.value)
}
}

// Not from SQLFluff but translates Python value error
#[derive(Debug)]
pub struct ValueError {
Expand Down

0 comments on commit 67f5a9b

Please sign in to comment.