Use Display for formatter parse errors (#9316)
## Summary This helps a bit with (but does not close) the issues described in https://github.com/astral-sh/ruff/issues/9311. E.g., now, we at least see: `error: Failed to format main.py: source contains syntax errors: invalid syntax. Got unexpected token '=' at byte offset 20`.
This commit is contained in:
@@ -108,9 +108,9 @@ where
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum FormatModuleError {
|
||||
#[error("source contains syntax errors: {0:?}")]
|
||||
#[error("source contains syntax errors: {0}")]
|
||||
LexError(LexicalError),
|
||||
#[error("source contains syntax errors: {0:?}")]
|
||||
#[error("source contains syntax errors: {0}")]
|
||||
ParseError(ParseError),
|
||||
#[error(transparent)]
|
||||
FormatError(#[from] FormatError),
|
||||
|
||||
Reference in New Issue
Block a user