Skip to content

Commit

Permalink
Trim SQL in DatabaseError descriptoin
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Oct 8, 2023
1 parent e22bf8f commit c7047c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions GRDB/Core/DatabaseError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ extension DatabaseError: CustomStringConvertible {
description += ": \(message)"
}
if let sql {
description += " - while executing `\(sql)`"
description += " - while executing `\(sql.trimmedSQLStatement)`"
}
if publicStatementArguments, let arguments, !arguments.isEmpty {
description += " with arguments \(arguments)"
Expand Down Expand Up @@ -577,7 +577,7 @@ extension DatabaseError: CustomStringConvertible {
description += ": \(message)"
}
if let sql {
description += " - while executing `\(sql)`"
description += " - while executing `\(sql.trimmedSQLStatement)`"
}
if let arguments, !arguments.isEmpty {
description += " with arguments \(arguments)"
Expand Down
2 changes: 1 addition & 1 deletion Tests/GRDBTests/UpdateStatementTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class UpdateStatementTests : GRDBTestCase {
XCTAssertEqual(error.description, """
SQLite error 21: Multiple statements found. To execute multiple statements, \
use Database.execute(sql:) or Database.allStatements(sql:) instead. \
- while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2;`
- while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2`
""")
}
}
Expand Down

0 comments on commit c7047c4

Please sign in to comment.