From 3877e8729c416cbfd4bda95b60a1e83587cf4b4e Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 2 Jan 2019 11:12:25 -0800 Subject: [PATCH] add Error::is_runtime_startup() method --- src/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/error.rs b/src/error.rs index 6a7d86e..0ac7acb 100644 --- a/src/error.rs +++ b/src/error.rs @@ -209,6 +209,14 @@ impl Error { _ => None, } } + + /// Returns true if this error is due to a failure starting the runtime. + pub fn is_runtime_startup(&self) -> bool { + match self.inner.kind { + Kind::RuntimeStartupFailure => true, + _ => false, + } + } } impl fmt::Debug for Error {