We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0dc6c61 commit 16b984aCopy full SHA for 16b984a
tokio-postgres/src/error/mod.rs
@@ -250,10 +250,10 @@ impl DbError {
250
ErrorPosition::Original(idx) => (self.statement.as_deref()?, *idx),
251
ErrorPosition::Internal { position, query } => (query.as_str(), *position),
252
};
253
- let (first, last) = sql.split_at_checked(pos as usize)?;
+ let (first, last) = sql.split_at_checked(pos.saturating_sub(1) as usize)?;
254
let first = first.lines().last().unwrap_or_default();
255
let last = last.lines().next().unwrap_or_default();
256
- Some(format!("{first}{{!ERROR!}}{last}"))
+ Some(format!("{first}/*ERROR =>*/{last}"))
257
}
258
259
/// An indication of the context in which the error occurred.
0 commit comments