Skip to content

Commit 89f9345

Browse files
authored
RUST-1574 Default errmsg field to empty string (#829)
1 parent e28a9bf commit 89f9345

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ pub struct CommandError {
608608
pub code_name: String,
609609

610610
/// A description of the error that occurred.
611-
#[serde(rename = "errmsg")]
611+
#[serde(rename = "errmsg", default = "String::new")]
612612
pub message: String,
613613

614614
/// The topology version reported by the server in the error response.
@@ -648,7 +648,7 @@ pub struct WriteConcernError {
648648
pub code_name: String,
649649

650650
/// A description of the error that occurred.
651-
#[serde(rename = "errmsg")]
651+
#[serde(rename = "errmsg", default = "String::new")]
652652
pub message: String,
653653

654654
/// A document identifying the write concern setting related to the error.
@@ -687,7 +687,7 @@ pub struct WriteError {
687687
pub code_name: Option<String>,
688688

689689
/// A description of the error that occurred.
690-
#[serde(rename = "errmsg")]
690+
#[serde(rename = "errmsg", default = "String::new")]
691691
pub message: String,
692692

693693
/// A document providing more information about the write error (e.g. details
@@ -725,7 +725,7 @@ pub struct BulkWriteError {
725725
pub code_name: Option<String>,
726726

727727
/// A description of the error that occurred.
728-
#[serde(rename = "errmsg")]
728+
#[serde(rename = "errmsg", default = "String::new")]
729729
pub message: String,
730730

731731
/// A document providing more information about the write error (e.g. details

0 commit comments

Comments
 (0)