summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api/src
diff options
context:
space:
mode:
Diffstat (limited to 'mullvad-api/src')
-rw-r--r--mullvad-api/src/rest.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs
index d174c3d19c..84560e07ba 100644
--- a/mullvad-api/src/rest.rs
+++ b/mullvad-api/src/rest.rs
@@ -84,6 +84,13 @@ impl Error {
}
}
+ pub fn is_aborted(&self) -> bool {
+ match self {
+ Error::Aborted => true,
+ _ => false,
+ }
+ }
+
/// Returns a new instance for which `abortable_stream::Aborted` is mapped to `Self::Aborted`.
fn map_aborted(self) -> Self {
if let Error::HyperError(error) = &self {