Skip to content

Commit 16b984a

Browse files
committed
Update error marker
1 parent 0dc6c61 commit 16b984a

File tree

1 file changed

+2
-2
lines changed
  • tokio-postgres/src/error

1 file changed

+2
-2
lines changed

tokio-postgres/src/error/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ impl DbError {
250250
ErrorPosition::Original(idx) => (self.statement.as_deref()?, *idx),
251251
ErrorPosition::Internal { position, query } => (query.as_str(), *position),
252252
};
253-
let (first, last) = sql.split_at_checked(pos as usize)?;
253+
let (first, last) = sql.split_at_checked(pos.saturating_sub(1) as usize)?;
254254
let first = first.lines().last().unwrap_or_default();
255255
let last = last.lines().next().unwrap_or_default();
256-
Some(format!("{first}{{!ERROR!}}{last}"))
256+
Some(format!("{first}/*ERROR =>*/{last}"))
257257
}
258258

259259
/// An indication of the context in which the error occurred.

0 commit comments

Comments
 (0)