Skip to content

Commit f769d0b

Browse files
committed
Make line/file/routine in Error optional
cc rust-postgres#171
1 parent 3bb055a commit f769d0b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/error/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ pub struct DbError {
7272
pub constraint: Option<String>,
7373

7474
/// The file name of the source-code location where the error was reported.
75-
pub file: String,
75+
pub file: Option<String>,
7676

7777
/// The line number of the source-code location where the error was
7878
/// reported.
79-
pub line: u32,
79+
pub line: Option<u32>,
8080

8181
/// The name of the source-code routine reporting the error.
82-
pub routine: String,
82+
pub routine: Option<String>,
8383

8484
_p: (),
8585
}
@@ -113,9 +113,9 @@ impl DbErrorNew for DbError {
113113
column: map.remove(&b'c'),
114114
datatype: map.remove(&b'd'),
115115
constraint: map.remove(&b'n'),
116-
file: try!(map.remove(&b'F').ok_or(())),
117-
line: try!(map.remove(&b'L').and_then(|l| l.parse().ok()).ok_or(())),
118-
routine: try!(map.remove(&b'R').ok_or(())),
116+
file: map.remove(&b'F'),
117+
line: map.remove(&b'L').and_then(|l| l.parse().ok()),
118+
routine: map.remove(&b'R'),
119119
_p: (),
120120
})
121121
}

0 commit comments

Comments
 (0)