File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,14 @@ pub trait DatabaseError: 'static + Send + Sync + StdError {
212
212
None
213
213
}
214
214
215
+ /// Returns the name of the table that was affected by the error, if applicable.
216
+ ///
217
+ /// ### Note
218
+ /// Currently only populated by the Postgres driver.
219
+ fn table ( & self ) -> Option < & str > {
220
+ None
221
+ }
222
+
215
223
/// Returns the kind of the error, if supported.
216
224
///
217
225
/// ### Note
Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ impl DatabaseError for PgDatabaseError {
204
204
self . constraint ( )
205
205
}
206
206
207
+ fn table ( & self ) -> Option < & str > {
208
+ self . table ( )
209
+ }
210
+
207
211
fn kind ( & self ) -> ErrorKind {
208
212
match self . code ( ) {
209
213
error_codes:: UNIQUE_VIOLATION => ErrorKind :: UniqueViolation ,
You can’t perform that action at this time.
0 commit comments