diff --git a/error.js b/error.js
index <HASH>..<HASH> 100644
--- a/error.js
+++ b/error.js
@@ -42,6 +42,10 @@ class MongoError extends Error {
   static create(options) {
     return new MongoError(options);
   }
+
+  hasErrorLabel(label) {
+    return this.errorLabels && this.errorLabels.indexOf(label) !== -1;
+  }
 }
 
 /**
feat(error): all `hasErrorLabel` method to MongoError

This improves readability in the transactions code when branching
on error labels for certain retry scenarios.