Skip to content

Commit 4f3bfdf

Browse files
committed
Remove some unused fields from ConcreteAppError
1 parent 4a1542c commit 4f3bfdf

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/util/errors.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,12 @@ impl<E: Error + Send + 'static> From<E> for Box<dyn AppError> {
198198
#[derive(Debug)]
199199
struct ConcreteAppError {
200200
description: String,
201-
detail: Option<String>,
202-
cause: Option<Box<dyn AppError>>,
203201
cargo_err: bool,
204202
}
205203

206204
impl fmt::Display for ConcreteAppError {
207205
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
208206
write!(f, "{}", self.description)?;
209-
if let Some(ref s) = self.detail {
210-
write!(f, " ({})", s)?;
211-
}
212207
Ok(())
213208
}
214209
}
@@ -218,7 +213,7 @@ impl AppError for ConcreteAppError {
218213
&self.description
219214
}
220215
fn cause(&self) -> Option<&dyn AppError> {
221-
self.cause.as_ref().map(|c| &**c)
216+
None
222217
}
223218
fn response(&self) -> Option<Response> {
224219
self.fallback_response()
@@ -306,17 +301,13 @@ impl fmt::Display for BadRequest {
306301
pub fn internal<S: ToString + ?Sized>(error: &S) -> Box<dyn AppError> {
307302
Box::new(ConcreteAppError {
308303
description: error.to_string(),
309-
detail: None,
310-
cause: None,
311304
cargo_err: false,
312305
})
313306
}
314307

315308
pub fn cargo_err<S: ToString + ?Sized>(error: &S) -> Box<dyn AppError> {
316309
Box::new(ConcreteAppError {
317310
description: error.to_string(),
318-
detail: None,
319-
cause: None,
320311
cargo_err: true,
321312
})
322313
}

0 commit comments

Comments
 (0)