diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 0.1.7.0
+
+* Add `bracketWithError`
+
 ## 0.1.6.0
 
 * Reuse the `Handler` definition from `Control.Monad.Catch`
diff --git a/safe-exceptions.cabal b/safe-exceptions.cabal
--- a/safe-exceptions.cabal
+++ b/safe-exceptions.cabal
@@ -1,5 +1,5 @@
 name:                safe-exceptions
-version:             0.1.6.0
+version:             0.1.7.0
 synopsis:            Safe, consistent, and easy exception handling
 description:         Please see README.md
 homepage:            https://github.com/fpco/safe-exceptions#readme
diff --git a/src/Control/Exception/Safe.hs b/src/Control/Exception/Safe.hs
--- a/src/Control/Exception/Safe.hs
+++ b/src/Control/Exception/Safe.hs
@@ -56,6 +56,7 @@
     , withException
     , bracketOnError
     , bracketOnError_
+    , bracketWithError
 
       -- * Coercion to sync and async
     , SyncExceptionWrapper (..)
@@ -375,25 +376,10 @@
 
 -- | Async safe version of 'E.bracket'
 --
--- @since 0.1.0.0
+-- @since 0.1.7.0
 bracket :: forall m a b c. C.MonadMask m
         => m a -> (a -> m b) -> (a -> m c) -> m c
-bracket before after thing = C.mask $ \restore -> do
-    x <- before
-    res1 <- C.try $ restore (thing x)
-    case res1 of
-        Left (e1 :: SomeException) -> do
-            -- explicitly ignore exceptions from after. We know that
-            -- no async exceptions were thrown there, so therefore
-            -- the stronger exception must come from thing
-            --
-            -- https://github.com/fpco/safe-exceptions/issues/2
-            _ :: Either SomeException b <-
-                C.try $ C.uninterruptibleMask_ $ after x
-            C.throwM e1
-        Right y -> do
-            _ <- C.uninterruptibleMask_ $ after x
-            return y
+bracket before after = bracketWithError before (const after)
 
 -- | Async safe version of 'E.bracket_'
 --
@@ -438,6 +424,29 @@
 -- @since 0.1.0.0
 bracketOnError_ :: C.MonadMask m => m a -> m b -> m c -> m c
 bracketOnError_ before after thing = bracketOnError before (const after) (const thing)
+
+-- | Async safe version of 'E.bracket' with access to the exception in the
+-- cleanup action.
+--
+-- @since 0.1.0.0
+bracketWithError :: forall m a b c. C.MonadMask m
+        => m a -> (Maybe SomeException -> a -> m b) -> (a -> m c) -> m c
+bracketWithError before after thing = C.mask $ \restore -> do
+    x <- before
+    res1 <- C.try $ restore (thing x)
+    case res1 of
+        Left (e1 :: SomeException) -> do
+            -- explicitly ignore exceptions from after. We know that
+            -- no async exceptions were thrown there, so therefore
+            -- the stronger exception must come from thing
+            --
+            -- https://github.com/fpco/safe-exceptions/issues/2
+            _ :: Either SomeException b <-
+                C.try $ C.uninterruptibleMask_ $ after (Just e1) x
+            C.throwM e1
+        Right y -> do
+            _ <- C.uninterruptibleMask_ $ after Nothing x
+            return y
 
 -- | Wrap up an asynchronous exception to be treated as a synchronous
 -- exception
