Commits

Mike Bayer committed 3d4fb58

- Exception messages are truncated when the list of bound
parameters is larger than 10, preventing enormous
multi-page exceptions from filling up screens and logfiles
for large executemany() statements. [ticket:1413]

  • Participants
  • Parent commits 4c15489

Comments (0)

Files changed (2)

       identifiers, such as 'database.owner'. [ticket: 594, 1341]
 
 - sql
+    - Exception messages are truncated when the list of bound 
+      parameters is larger than 10, preventing enormous
+      multi-page exceptions from filling up screens and logfiles
+      for large executemany() statements. [ticket:1413]
+      
     - ``sqlalchemy.extract()`` is now dialect sensitive and can
       extract components of timestamps idiomatically across the
       supported databases, including SQLite.

File lib/sqlalchemy/exc.py

         self.connection_invalidated = connection_invalidated
 
     def __str__(self):
+        if len(self.params) > 10:
+            return ' '.join((SQLAlchemyError.__str__(self),
+                             repr(self.statement),
+                             repr(self.params[:2]),
+                             '... and a total of %i bound parameters' % len(self.params)))
         return ' '.join((SQLAlchemyError.__str__(self),
                          repr(self.statement), repr(self.params)))