We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
chain_error
internal
1 parent a5a451e commit e86de9bCopy full SHA for e86de9b
src/util/errors.rs
@@ -342,3 +342,23 @@ impl fmt::Display for TooManyRequests {
342
"Too many requests".fmt(f)
343
}
344
345
+
346
+#[test]
347
+fn chain_error_internal() {
348
+ assert_eq!(
349
+ None::<()>
350
+ .chain_error(|| internal("inner"))
351
+ .chain_error(|| internal("middle"))
352
+ .chain_error(|| internal("outer"))
353
+ .unwrap_err()
354
+ .to_string(),
355
+ "outer caused by middle caused by inner"
356
+ );
357
358
+ Err::<(), _>(internal("inner"))
359
360
361
362
+ "outer caused by inner"
363
364
+}
0 commit comments