diff --git a/ghcjs-dom-jsffi.cabal b/ghcjs-dom-jsffi.cabal
--- a/ghcjs-dom-jsffi.cabal
+++ b/ghcjs-dom-jsffi.cabal
@@ -1,5 +1,5 @@
 name: ghcjs-dom-jsffi
-version: 0.9.1.1
+version: 0.9.2.0
 cabal-version: >=1.24
 build-type: Simple
 license: MIT
diff --git a/src/GHCJS/DOM/JSFFI/Generated/ApplePaySession.hs b/src/GHCJS/DOM/JSFFI/Generated/ApplePaySession.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/ApplePaySession.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/ApplePaySession.hs
@@ -89,9 +89,9 @@
 canMakePayments_ self = liftIO (void (js_canMakePayments self))
  
 foreign import javascript interruptible
-        "$1[\"canMakePaymentsWithActiveCard\"]($2).\nthen($c);"
+        "$1[\"canMakePaymentsWithActiveCard\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_canMakePaymentsWithActiveCard ::
-        ApplePaySession -> JSString -> IO Bool
+        ApplePaySession -> JSString -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ApplePaySession.canMakePaymentsWithActiveCard Mozilla ApplePaySession.canMakePaymentsWithActiveCard documentation> 
 canMakePaymentsWithActiveCard ::
@@ -99,8 +99,9 @@
                                 ApplePaySession -> merchantIdentifier -> m Bool
 canMakePaymentsWithActiveCard self merchantIdentifier
   = liftIO
-      (js_canMakePaymentsWithActiveCard self
-         (toJSString merchantIdentifier))
+      ((js_canMakePaymentsWithActiveCard self
+          (toJSString merchantIdentifier))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ApplePaySession.canMakePaymentsWithActiveCard Mozilla ApplePaySession.canMakePaymentsWithActiveCard documentation> 
 canMakePaymentsWithActiveCard_ ::
@@ -113,15 +114,18 @@
             (toJSString merchantIdentifier)))
  
 foreign import javascript interruptible
-        "$1[\"openPaymentSetup\"]($2).\nthen($c);" js_openPaymentSetup ::
-        ApplePaySession -> JSString -> IO Bool
+        "$1[\"openPaymentSetup\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_openPaymentSetup ::
+        ApplePaySession -> JSString -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ApplePaySession.openPaymentSetup Mozilla ApplePaySession.openPaymentSetup documentation> 
 openPaymentSetup ::
                  (MonadIO m, ToJSString merchantIdentifier) =>
                    ApplePaySession -> merchantIdentifier -> m Bool
 openPaymentSetup self merchantIdentifier
-  = liftIO (js_openPaymentSetup self (toJSString merchantIdentifier))
+  = liftIO
+      ((js_openPaymentSetup self (toJSString merchantIdentifier)) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ApplePaySession.openPaymentSetup Mozilla ApplePaySession.openPaymentSetup documentation> 
 openPaymentSetup_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/AudioContext.hs b/src/GHCJS/DOM/JSFFI/Generated/AudioContext.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/AudioContext.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/AudioContext.hs
@@ -63,25 +63,34 @@
 newAudioContext = liftIO (js_newAudioContext)
  
 foreign import javascript interruptible
-        "$1[\"suspend\"]().then($c);" js_suspend :: AudioContext -> IO ()
+        "$1[\"suspend\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_suspend :: AudioContext -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/AudioContext.suspend Mozilla AudioContext.suspend documentation> 
 suspend :: (MonadIO m, IsAudioContext self) => self -> m ()
-suspend self = liftIO (js_suspend (toAudioContext self))
+suspend self
+  = liftIO
+      ((js_suspend (toAudioContext self)) >>= maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"resume\"]().then($c);" js_resume :: AudioContext -> IO ()
+        "$1[\"resume\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_resume :: AudioContext -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/AudioContext.resume Mozilla AudioContext.resume documentation> 
 resume :: (MonadIO m, IsAudioContext self) => self -> m ()
-resume self = liftIO (js_resume (toAudioContext self))
+resume self
+  = liftIO
+      ((js_resume (toAudioContext self)) >>= maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"close\"]().then($c);" js_close :: AudioContext -> IO ()
+        "$1[\"close\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_close :: AudioContext -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/AudioContext.close Mozilla AudioContext.close documentation> 
 close :: (MonadIO m, IsAudioContext self) => self -> m ()
-close self = liftIO (js_close (toAudioContext self))
+close self
+  = liftIO
+      ((js_close (toAudioContext self)) >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"createBuffer\"]($2, $3, $4)"
         js_createBuffer ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/Body.hs b/src/GHCJS/DOM/JSFFI/Generated/Body.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/Body.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/Body.hs
@@ -28,46 +28,52 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"arrayBuffer\"]().then($c);" js_arrayBuffer ::
-        Body -> IO ArrayBuffer
+        "$1[\"arrayBuffer\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_arrayBuffer :: Body -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.arrayBuffer Mozilla Body.arrayBuffer documentation> 
 arrayBuffer :: (MonadIO m, IsBody self) => self -> m ArrayBuffer
-arrayBuffer self = liftIO (js_arrayBuffer (toBody self))
+arrayBuffer self
+  = liftIO ((js_arrayBuffer (toBody self)) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.arrayBuffer Mozilla Body.arrayBuffer documentation> 
 arrayBuffer_ :: (MonadIO m, IsBody self) => self -> m ()
 arrayBuffer_ self = liftIO (void (js_arrayBuffer (toBody self)))
  
 foreign import javascript interruptible
-        "$1[\"blob\"]().then($c);" js_blob :: Body -> IO Blob
+        "$1[\"blob\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_blob :: Body -> IO (JSVal, Blob)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.blob Mozilla Body.blob documentation> 
 blob :: (MonadIO m, IsBody self) => self -> m Blob
-blob self = liftIO (js_blob (toBody self))
+blob self = liftIO ((js_blob (toBody self)) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.blob Mozilla Body.blob documentation> 
 blob_ :: (MonadIO m, IsBody self) => self -> m ()
 blob_ self = liftIO (void (js_blob (toBody self)))
  
 foreign import javascript interruptible
-        "$1[\"json\"]().then($c);" js_json :: Body -> IO JSVal
+        "$1[\"json\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_json :: Body -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.json Mozilla Body.json documentation> 
 json :: (MonadIO m, IsBody self) => self -> m JSVal
-json self = liftIO (js_json (toBody self))
+json self = liftIO ((js_json (toBody self)) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.json Mozilla Body.json documentation> 
 json_ :: (MonadIO m, IsBody self) => self -> m ()
 json_ self = liftIO (void (js_json (toBody self)))
  
 foreign import javascript interruptible
-        "$1[\"text\"]().then($c);" js_text :: Body -> IO JSString
+        "$1[\"text\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_text :: Body -> IO (JSVal, JSString)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.text Mozilla Body.text documentation> 
 text ::
      (MonadIO m, IsBody self, FromJSString result) => self -> m result
-text self = liftIO (fromJSString <$> (js_text (toBody self)))
+text self
+  = liftIO
+      (fromJSString <$> ((js_text (toBody self)) >>= checkPromiseResult))
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Body.text Mozilla Body.text documentation> 
 text_ :: (MonadIO m, IsBody self) => self -> m ()
diff --git a/src/GHCJS/DOM/JSFFI/Generated/CustomElementRegistry.hs b/src/GHCJS/DOM/JSFFI/Generated/CustomElementRegistry.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/CustomElementRegistry.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/CustomElementRegistry.hs
@@ -53,12 +53,14 @@
 get_ self name = liftIO (void (js_get self (toJSString name)))
  
 foreign import javascript interruptible
-        "$1[\"whenDefined\"]($2).then($c);" js_whenDefined ::
-        CustomElementRegistry -> JSString -> IO ()
+        "$1[\"whenDefined\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_whenDefined :: CustomElementRegistry -> JSString -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry.whenDefined Mozilla CustomElementRegistry.whenDefined documentation> 
 whenDefined ::
             (MonadIO m, ToJSString name) =>
               CustomElementRegistry -> name -> m ()
 whenDefined self name
-  = liftIO (js_whenDefined self (toJSString name))
+  = liftIO
+      ((js_whenDefined self (toJSString name)) >>=
+         maybeThrowPromiseRejected)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/FontFace.hs b/src/GHCJS/DOM/JSFFI/Generated/FontFace.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/FontFace.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/FontFace.hs
@@ -50,11 +50,12 @@
          (maybeToOptional descriptors))
  
 foreign import javascript interruptible
-        "$1[\"load\"]().then($c);" js_load :: FontFace -> IO FontFace
+        "$1[\"load\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_load :: FontFace -> IO (JSVal, FontFace)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFace.load Mozilla FontFace.load documentation> 
 load :: (MonadIO m) => FontFace -> m FontFace
-load self = liftIO (js_load self)
+load self = liftIO ((js_load self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFace.load Mozilla FontFace.load documentation> 
 load_ :: (MonadIO m) => FontFace -> m ()
@@ -182,8 +183,10 @@
   = liftIO ((js_getStatus self) >>= fromJSValUnchecked)
  
 foreign import javascript interruptible
-        "$1[\"loaded\"].then($c);" js_getLoaded :: FontFace -> IO FontFace
+        "$1[\"loaded\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getLoaded :: FontFace -> IO (JSVal, FontFace)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFace.loaded Mozilla FontFace.loaded documentation> 
 getLoaded :: (MonadIO m) => FontFace -> m FontFace
-getLoaded self = liftIO (js_getLoaded self)
+getLoaded self
+  = liftIO ((js_getLoaded self) >>= checkPromiseResult)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/FontFaceSet.hs b/src/GHCJS/DOM/JSFFI/Generated/FontFaceSet.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/FontFaceSet.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/FontFaceSet.hs
@@ -80,8 +80,9 @@
 clear self = liftIO (js_clear self)
  
 foreign import javascript interruptible
-        "$1[\"load\"]($2, $3).then($c);" js_load ::
-        FontFaceSet -> JSString -> Optional JSString -> IO JSVal
+        "$1[\"load\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_load ::
+        FontFaceSet -> JSString -> Optional JSString -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet.load Mozilla FontFaceSet.load documentation> 
 load ::
@@ -89,8 +90,9 @@
        FontFaceSet -> font -> Maybe text -> m [FontFace]
 load self font text
   = liftIO
-      ((js_load self (toJSString font) (toOptionalJSString text)) >>=
-         fromJSValUnchecked)
+      (((js_load self (toJSString font) (toOptionalJSString text)) >>=
+          checkPromiseResult)
+         >>= fromJSValUnchecked)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet.load Mozilla FontFaceSet.load documentation> 
 load_ ::
@@ -139,12 +141,12 @@
 loadingerror = unsafeEventName (toJSString "loadingerror")
  
 foreign import javascript interruptible
-        "$1[\"ready\"].then($c);" js_getReady ::
-        FontFaceSet -> IO FontFaceSet
+        "$1[\"ready\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getReady :: FontFaceSet -> IO (JSVal, FontFaceSet)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet.ready Mozilla FontFaceSet.ready documentation> 
 getReady :: (MonadIO m) => FontFaceSet -> m FontFaceSet
-getReady self = liftIO (js_getReady self)
+getReady self = liftIO ((js_getReady self) >>= checkPromiseResult)
  
 foreign import javascript unsafe "$1[\"status\"]" js_getStatus ::
         FontFaceSet -> IO JSVal
diff --git a/src/GHCJS/DOM/JSFFI/Generated/HTMLMediaElement.hs b/src/GHCJS/DOM/JSFFI/Generated/HTMLMediaElement.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/HTMLMediaElement.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/HTMLMediaElement.hs
@@ -119,11 +119,14 @@
   = liftIO (void (js_getStartDate (toHTMLMediaElement self)))
  
 foreign import javascript interruptible
-        "$1[\"play\"]().then($c);" js_play :: HTMLMediaElement -> IO ()
+        "$1[\"play\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_play :: HTMLMediaElement -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement.play Mozilla HTMLMediaElement.play documentation> 
 play :: (MonadIO m, IsHTMLMediaElement self) => self -> m ()
-play self = liftIO (js_play (toHTMLMediaElement self))
+play self
+  = liftIO
+      ((js_play (toHTMLMediaElement self)) >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"pause\"]()" js_pause ::
         HTMLMediaElement -> IO ()
@@ -155,8 +158,9 @@
          (maybeToOptional mediaKeys))
  
 foreign import javascript interruptible
-        "$1[\"setMediaKeys\"]($2).then($c);" js_setMediaKeys ::
-        HTMLMediaElement -> Optional MediaKeys -> IO ()
+        "$1[\"setMediaKeys\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_setMediaKeys ::
+        HTMLMediaElement -> Optional MediaKeys -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement.setMediaKeys Mozilla HTMLMediaElement.setMediaKeys documentation> 
 setMediaKeys ::
@@ -164,8 +168,9 @@
                self -> Maybe MediaKeys -> m ()
 setMediaKeys self mediaKeys
   = liftIO
-      (js_setMediaKeys (toHTMLMediaElement self)
-         (maybeToOptional mediaKeys))
+      ((js_setMediaKeys (toHTMLMediaElement self)
+          (maybeToOptional mediaKeys))
+         >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"addTextTrack\"]($2, $3, $4)"
         js_addTextTrack ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/MediaDevices.hs b/src/GHCJS/DOM/JSFFI/Generated/MediaDevices.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/MediaDevices.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/MediaDevices.hs
@@ -29,14 +29,16 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"enumerateDevices\"]().\nthen($c);" js_enumerateDevices ::
-        MediaDevices -> IO JSVal
+        "$1[\"enumerateDevices\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_enumerateDevices :: MediaDevices -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices.enumerateDevices Mozilla MediaDevices.enumerateDevices documentation> 
 enumerateDevices ::
                  (MonadIO m) => MediaDevices -> m [MediaDeviceInfo]
 enumerateDevices self
-  = liftIO ((js_enumerateDevices self) >>= fromJSValUnchecked)
+  = liftIO
+      (((js_enumerateDevices self) >>= checkPromiseResult) >>=
+         fromJSValUnchecked)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices.enumerateDevices Mozilla MediaDevices.enumerateDevices documentation> 
 enumerateDevices_ :: (MonadIO m) => MediaDevices -> m ()
@@ -58,15 +60,19 @@
   = liftIO (void (js_getSupportedConstraints self))
  
 foreign import javascript interruptible
-        "$1[\"getUserMedia\"]($2).then($c);" js_getUserMedia ::
-        MediaDevices -> Optional MediaStreamConstraints -> IO MediaStream
+        "$1[\"getUserMedia\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getUserMedia ::
+        MediaDevices ->
+          Optional MediaStreamConstraints -> IO (JSVal, MediaStream)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices.getUserMedia Mozilla MediaDevices.getUserMedia documentation> 
 getUserMedia ::
              (MonadIO m) =>
                MediaDevices -> Maybe MediaStreamConstraints -> m MediaStream
 getUserMedia self constraints
-  = liftIO (js_getUserMedia self (maybeToOptional constraints))
+  = liftIO
+      ((js_getUserMedia self (maybeToOptional constraints)) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices.getUserMedia Mozilla MediaDevices.getUserMedia documentation> 
 getUserMedia_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/MediaKeySession.hs b/src/GHCJS/DOM/JSFFI/Generated/MediaKeySession.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/MediaKeySession.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/MediaKeySession.hs
@@ -31,8 +31,9 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"generateRequest\"]($2, $3).\nthen($c);" js_generateRequest ::
-        MediaKeySession -> JSString -> BufferSource -> IO ()
+        "$1[\"generateRequest\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_generateRequest ::
+        MediaKeySession -> JSString -> BufferSource -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.generateRequest Mozilla WebKitMediaKeySession.generateRequest documentation> 
 generateRequest ::
@@ -40,18 +41,21 @@
                   MediaKeySession -> initDataType -> initData -> m ()
 generateRequest self initDataType initData
   = liftIO
-      (js_generateRequest self (toJSString initDataType)
-         (toBufferSource initData))
+      ((js_generateRequest self (toJSString initDataType)
+          (toBufferSource initData))
+         >>= maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"load\"]($2).then($c);" js_load ::
-        MediaKeySession -> JSString -> IO Bool
+        "$1[\"load\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_load :: MediaKeySession -> JSString -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.load Mozilla WebKitMediaKeySession.load documentation> 
 load ::
      (MonadIO m, ToJSString sessionId) =>
        MediaKeySession -> sessionId -> m Bool
-load self sessionId = liftIO (js_load self (toJSString sessionId))
+load self sessionId
+  = liftIO
+      ((js_load self (toJSString sessionId)) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.load Mozilla WebKitMediaKeySession.load documentation> 
 load_ ::
@@ -61,29 +65,34 @@
   = liftIO (void (js_load self (toJSString sessionId)))
  
 foreign import javascript interruptible
-        "$1[\"update\"]($2).then($c);" js_update ::
-        MediaKeySession -> BufferSource -> IO ()
+        "$1[\"update\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_update :: MediaKeySession -> BufferSource -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.update Mozilla WebKitMediaKeySession.update documentation> 
 update ::
        (MonadIO m, IsBufferSource response) =>
          MediaKeySession -> response -> m ()
 update self response
-  = liftIO (js_update self (toBufferSource response))
+  = liftIO
+      ((js_update self (toBufferSource response)) >>=
+         maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"close\"]().then($c);" js_close :: MediaKeySession -> IO ()
+        "$1[\"close\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_close :: MediaKeySession -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.close Mozilla WebKitMediaKeySession.close documentation> 
 close :: (MonadIO m) => MediaKeySession -> m ()
-close self = liftIO (js_close self)
+close self = liftIO ((js_close self) >>= maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"remove\"]().then($c);" js_remove :: MediaKeySession -> IO ()
+        "$1[\"remove\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_remove :: MediaKeySession -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.remove Mozilla WebKitMediaKeySession.remove documentation> 
 remove :: (MonadIO m) => MediaKeySession -> m ()
-remove self = liftIO (js_remove self)
+remove self
+  = liftIO ((js_remove self) >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"sessionId\"]"
         js_getSessionId :: MediaKeySession -> IO JSString
@@ -102,11 +111,13 @@
 getExpiration self = liftIO (js_getExpiration self)
  
 foreign import javascript interruptible
-        "$1[\"closed\"].then($c);" js_getClosed :: MediaKeySession -> IO ()
+        "$1[\"closed\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getClosed :: MediaKeySession -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeySession.closed Mozilla WebKitMediaKeySession.closed documentation> 
 getClosed :: (MonadIO m) => MediaKeySession -> m ()
-getClosed self = liftIO (js_getClosed self)
+getClosed self
+  = liftIO ((js_getClosed self) >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"keyStatuses\"]"
         js_getKeyStatuses :: MediaKeySession -> IO MediaKeyStatusMap
diff --git a/src/GHCJS/DOM/JSFFI/Generated/MediaKeySystemAccess.hs b/src/GHCJS/DOM/JSFFI/Generated/MediaKeySystemAccess.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/MediaKeySystemAccess.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/MediaKeySystemAccess.hs
@@ -43,13 +43,14 @@
 getConfiguration_ self = liftIO (void (js_getConfiguration self))
  
 foreign import javascript interruptible
-        "$1[\"createMediaKeys\"]().\nthen($c);" js_createMediaKeys ::
-        MediaKeySystemAccess -> IO MediaKeys
+        "$1[\"createMediaKeys\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_createMediaKeys :: MediaKeySystemAccess -> IO (JSVal, MediaKeys)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySystemAccess.createMediaKeys Mozilla MediaKeySystemAccess.createMediaKeys documentation> 
 createMediaKeys ::
                 (MonadIO m) => MediaKeySystemAccess -> m MediaKeys
-createMediaKeys self = liftIO (js_createMediaKeys self)
+createMediaKeys self
+  = liftIO ((js_createMediaKeys self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySystemAccess.createMediaKeys Mozilla MediaKeySystemAccess.createMediaKeys documentation> 
 createMediaKeys_ :: (MonadIO m) => MediaKeySystemAccess -> m ()
diff --git a/src/GHCJS/DOM/JSFFI/Generated/MediaKeys.hs b/src/GHCJS/DOM/JSFFI/Generated/MediaKeys.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/MediaKeys.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/MediaKeys.hs
@@ -46,8 +46,9 @@
       (void (js_createSession self (maybeToOptional sessionType)))
  
 foreign import javascript interruptible
-        "$1[\"setServerCertificate\"]($2).\nthen($c);"
-        js_setServerCertificate :: MediaKeys -> BufferSource -> IO Bool
+        "$1[\"setServerCertificate\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_setServerCertificate ::
+        MediaKeys -> BufferSource -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeys.setServerCertificate Mozilla WebKitMediaKeys.setServerCertificate documentation> 
 setServerCertificate ::
@@ -55,7 +56,8 @@
                        MediaKeys -> serverCertificate -> m Bool
 setServerCertificate self serverCertificate
   = liftIO
-      (js_setServerCertificate self (toBufferSource serverCertificate))
+      ((js_setServerCertificate self (toBufferSource serverCertificate))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitMediaKeys.setServerCertificate Mozilla WebKitMediaKeys.setServerCertificate documentation> 
 setServerCertificate_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrack.hs b/src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrack.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrack.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrack.hs
@@ -101,8 +101,9 @@
   = liftIO (void (js_getSettings (toMediaStreamTrack self)))
  
 foreign import javascript interruptible
-        "$1[\"applyConstraints\"]($2).\nthen($c);" js_applyConstraints ::
-        MediaStreamTrack -> Optional MediaTrackConstraints -> IO ()
+        "$1[\"applyConstraints\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_applyConstraints ::
+        MediaStreamTrack -> Optional MediaTrackConstraints -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack.applyConstraints Mozilla MediaStreamTrack.applyConstraints documentation> 
 applyConstraints ::
@@ -110,8 +111,9 @@
                    self -> Maybe MediaTrackConstraints -> m ()
 applyConstraints self constraints
   = liftIO
-      (js_applyConstraints (toMediaStreamTrack self)
-         (maybeToOptional constraints))
+      ((js_applyConstraints (toMediaStreamTrack self)
+          (maybeToOptional constraints))
+         >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"kind\"]" js_getKind ::
         MediaStreamTrack -> IO JSString
diff --git a/src/GHCJS/DOM/JSFFI/Generated/Navigator.hs b/src/GHCJS/DOM/JSFFI/Generated/Navigator.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/Navigator.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/Navigator.hs
@@ -41,9 +41,9 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"requestMediaKeySystemAccess\"]($2,\n$3).\nthen($c);"
+        "$1[\"requestMediaKeySystemAccess\"]($2,\n$3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_requestMediaKeySystemAccess ::
-        Navigator -> JSString -> JSVal -> IO MediaKeySystemAccess
+        Navigator -> JSString -> JSVal -> IO (JSVal, MediaKeySystemAccess)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Navigator.requestMediaKeySystemAccess Mozilla Navigator.requestMediaKeySystemAccess documentation> 
 requestMediaKeySystemAccess ::
@@ -53,10 +53,11 @@
                                   [MediaKeySystemConfiguration] -> m MediaKeySystemAccess
 requestMediaKeySystemAccess self keySystem supportedConfiguration
   = liftIO
-      (toJSVal supportedConfiguration >>=
-         \ supportedConfiguration' ->
-           js_requestMediaKeySystemAccess self (toJSString keySystem)
-             supportedConfiguration')
+      ((toJSVal supportedConfiguration >>=
+          \ supportedConfiguration' ->
+            js_requestMediaKeySystemAccess self (toJSString keySystem)
+              supportedConfiguration')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Navigator.requestMediaKeySystemAccess Mozilla Navigator.requestMediaKeySystemAccess documentation> 
 requestMediaKeySystemAccess_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/PromiseRejectionEvent.hs b/src/GHCJS/DOM/JSFFI/Generated/PromiseRejectionEvent.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/PromiseRejectionEvent.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/PromiseRejectionEvent.hs
@@ -41,12 +41,13 @@
       (js_newPromiseRejectionEvent (toJSString type') eventInitDict)
  
 foreign import javascript interruptible
-        "$1[\"promise\"].then($c);" js_getPromise ::
-        PromiseRejectionEvent -> IO JSVal
+        "$1[\"promise\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getPromise :: PromiseRejectionEvent -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent.promise Mozilla PromiseRejectionEvent.promise documentation> 
 getPromise :: (MonadIO m) => PromiseRejectionEvent -> m JSVal
-getPromise self = liftIO (js_getPromise self)
+getPromise self
+  = liftIO ((js_getPromise self) >>= checkPromiseResult)
  
 foreign import javascript unsafe "$1[\"reason\"]" js_getReason ::
         PromiseRejectionEvent -> IO JSVal
diff --git a/src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnection.hs b/src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnection.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnection.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnection.hs
@@ -60,9 +60,10 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"createOffer\"]($2).then($c);" js_createOffer ::
+        "$1[\"createOffer\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_createOffer ::
         RTCPeerConnection ->
-          Optional RTCOfferOptions -> IO RTCSessionDescriptionInit
+          Optional RTCOfferOptions -> IO (JSVal, RTCSessionDescriptionInit)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.createOffer Mozilla webkitRTCPeerConnection.createOffer documentation> 
 createOffer ::
@@ -70,7 +71,9 @@
               RTCPeerConnection ->
                 Maybe RTCOfferOptions -> m RTCSessionDescriptionInit
 createOffer self offerOptions
-  = liftIO (js_createOffer self (maybeToOptional offerOptions))
+  = liftIO
+      ((js_createOffer self (maybeToOptional offerOptions)) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.createOffer Mozilla webkitRTCPeerConnection.createOffer documentation> 
 createOffer_ ::
@@ -80,9 +83,10 @@
       (void (js_createOffer self (maybeToOptional offerOptions)))
  
 foreign import javascript interruptible
-        "$1[\"createAnswer\"]($2).then($c);" js_createAnswer ::
+        "$1[\"createAnswer\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_createAnswer ::
         RTCPeerConnection ->
-          Optional RTCAnswerOptions -> IO RTCSessionDescriptionInit
+          Optional RTCAnswerOptions -> IO (JSVal, RTCSessionDescriptionInit)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.createAnswer Mozilla webkitRTCPeerConnection.createAnswer documentation> 
 createAnswer ::
@@ -90,7 +94,9 @@
                RTCPeerConnection ->
                  Maybe RTCAnswerOptions -> m RTCSessionDescriptionInit
 createAnswer self answerOptions
-  = liftIO (js_createAnswer self (maybeToOptional answerOptions))
+  = liftIO
+      ((js_createAnswer self (maybeToOptional answerOptions)) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.createAnswer Mozilla webkitRTCPeerConnection.createAnswer documentation> 
 createAnswer_ ::
@@ -100,32 +106,37 @@
       (void (js_createAnswer self (maybeToOptional answerOptions)))
  
 foreign import javascript interruptible
-        "$1[\"setLocalDescription\"]($2).\nthen($c);"
+        "$1[\"setLocalDescription\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_setLocalDescription ::
-        RTCPeerConnection -> RTCSessionDescriptionInit -> IO ()
+        RTCPeerConnection -> RTCSessionDescriptionInit -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.setLocalDescription Mozilla webkitRTCPeerConnection.setLocalDescription documentation> 
 setLocalDescription ::
                     (MonadIO m) =>
                       RTCPeerConnection -> RTCSessionDescriptionInit -> m ()
 setLocalDescription self description
-  = liftIO (js_setLocalDescription self description)
+  = liftIO
+      ((js_setLocalDescription self description) >>=
+         maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"setRemoteDescription\"]($2).\nthen($c);"
+        "$1[\"setRemoteDescription\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_setRemoteDescription ::
-        RTCPeerConnection -> RTCSessionDescriptionInit -> IO ()
+        RTCPeerConnection -> RTCSessionDescriptionInit -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.setRemoteDescription Mozilla webkitRTCPeerConnection.setRemoteDescription documentation> 
 setRemoteDescription ::
                      (MonadIO m) =>
                        RTCPeerConnection -> RTCSessionDescriptionInit -> m ()
 setRemoteDescription self description
-  = liftIO (js_setRemoteDescription self description)
+  = liftIO
+      ((js_setRemoteDescription self description) >>=
+         maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"addIceCandidate\"]($2).\nthen($c);" js_addIceCandidate ::
-        RTCPeerConnection -> RTCIceCandidateOrInit -> IO ()
+        "$1[\"addIceCandidate\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_addIceCandidate ::
+        RTCPeerConnection -> RTCIceCandidateOrInit -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.addIceCandidate Mozilla webkitRTCPeerConnection.addIceCandidate documentation> 
 addIceCandidate ::
@@ -133,9 +144,10 @@
                   RTCPeerConnection -> candidate -> m ()
 addIceCandidate self candidate
   = liftIO
-      (toJSVal candidate >>=
-         \ candidate' ->
-           js_addIceCandidate self (RTCIceCandidateOrInit candidate'))
+      ((toJSVal candidate >>=
+          \ candidate' ->
+            js_addIceCandidate self (RTCIceCandidateOrInit candidate'))
+         >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"getConfiguration\"]()"
         js_getConfiguration :: RTCPeerConnection -> IO RTCConfiguration
@@ -292,8 +304,10 @@
             (maybeToOptional options)))
  
 foreign import javascript interruptible
-        "$1[\"getStats\"]($2).then($c);" js_getStats ::
-        RTCPeerConnection -> Optional MediaStreamTrack -> IO RTCStatsReport
+        "$1[\"getStats\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getStats ::
+        RTCPeerConnection ->
+          Optional MediaStreamTrack -> IO (JSVal, RTCStatsReport)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.getStats Mozilla webkitRTCPeerConnection.getStats documentation> 
 getStats ::
@@ -301,8 +315,9 @@
            RTCPeerConnection -> Maybe selector -> m RTCStatsReport
 getStats self selector
   = liftIO
-      (js_getStats self
-         (maybeToOptional (fmap toMediaStreamTrack selector)))
+      ((js_getStats self
+          (maybeToOptional (fmap toMediaStreamTrack selector)))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/webkitRTCPeerConnection.getStats Mozilla webkitRTCPeerConnection.getStats documentation> 
 getStats_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/RTCRtpSender.hs b/src/GHCJS/DOM/JSFFI/Generated/RTCRtpSender.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/RTCRtpSender.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/RTCRtpSender.hs
@@ -39,8 +39,9 @@
 getParameters_ self = liftIO (void (js_getParameters self))
  
 foreign import javascript interruptible
-        "$1[\"replaceTrack\"]($2).then($c);" js_replaceTrack ::
-        RTCRtpSender -> Optional MediaStreamTrack -> IO ()
+        "$1[\"replaceTrack\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_replaceTrack ::
+        RTCRtpSender -> Optional MediaStreamTrack -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender.replaceTrack Mozilla RTCRtpSender.replaceTrack documentation> 
 replaceTrack ::
@@ -48,8 +49,9 @@
                RTCRtpSender -> Maybe withTrack -> m ()
 replaceTrack self withTrack
   = liftIO
-      (js_replaceTrack self
-         (maybeToOptional (fmap toMediaStreamTrack withTrack)))
+      ((js_replaceTrack self
+          (maybeToOptional (fmap toMediaStreamTrack withTrack)))
+         >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"track\"]" js_getTrack ::
         RTCRtpSender -> IO (Nullable MediaStreamTrack)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/ReadableStream.hs b/src/GHCJS/DOM/JSFFI/Generated/ReadableStream.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/ReadableStream.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/ReadableStream.hs
@@ -47,8 +47,8 @@
              (maybeToOptional options'))
  
 foreign import javascript interruptible
-        "$1[\"cancel\"]($2).then($c);" js_cancel ::
-        ReadableStream -> Optional JSVal -> IO JSVal
+        "$1[\"cancel\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_cancel :: ReadableStream -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.cancel Mozilla ReadableStream.cancel documentation> 
 cancel ::
@@ -56,8 +56,9 @@
          ReadableStream -> Maybe reason -> m JSVal
 cancel self reason
   = liftIO
-      (mapM toJSVal reason >>=
-         \ reason' -> js_cancel self (maybeToOptional reason'))
+      ((mapM toJSVal reason >>=
+          \ reason' -> js_cancel self (maybeToOptional reason'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.cancel Mozilla ReadableStream.cancel documentation> 
 cancel_ ::
@@ -92,8 +93,9 @@
             \ options' -> js_getReader self (maybeToOptional options')))
  
 foreign import javascript interruptible
-        "$1[\"pipeTo\"]($2, $3).then($c);" js_pipeTo ::
-        ReadableStream -> JSVal -> Optional JSVal -> IO JSVal
+        "$1[\"pipeTo\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_pipeTo ::
+        ReadableStream -> JSVal -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.pipeTo Mozilla ReadableStream.pipeTo documentation> 
 pipeTo ::
@@ -101,10 +103,11 @@
          ReadableStream -> streams -> Maybe options -> m JSVal
 pipeTo self streams options
   = liftIO
-      (mapM toJSVal options >>=
-         \ options' ->
-           toJSVal streams >>= \ streams' -> js_pipeTo self streams'
-             (maybeToOptional options'))
+      ((mapM toJSVal options >>=
+          \ options' ->
+            toJSVal streams >>= \ streams' -> js_pipeTo self streams'
+              (maybeToOptional options'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.pipeTo Mozilla ReadableStream.pipeTo documentation> 
 pipeTo_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamBYOBReader.hs b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamBYOBReader.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamBYOBReader.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamBYOBReader.hs
@@ -40,8 +40,9 @@
   = liftIO (js_newReadableStreamBYOBReader stream)
  
 foreign import javascript interruptible
-        "$1[\"read\"]($2).then($c);" js_read ::
-        ReadableStreamBYOBReader -> Optional JSVal -> IO JSVal
+        "$1[\"read\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_read ::
+        ReadableStreamBYOBReader -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.read Mozilla ReadableStreamBYOBReader.read documentation> 
 read ::
@@ -49,8 +50,9 @@
        ReadableStreamBYOBReader -> Maybe view -> m JSVal
 read self view
   = liftIO
-      (mapM toJSVal view >>=
-         \ view' -> js_read self (maybeToOptional view'))
+      ((mapM toJSVal view >>=
+          \ view' -> js_read self (maybeToOptional view'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.read Mozilla ReadableStreamBYOBReader.read documentation> 
 read_ ::
@@ -63,8 +65,9 @@
             \ view' -> js_read self (maybeToOptional view')))
  
 foreign import javascript interruptible
-        "$1[\"cancel\"]($2).then($c);" js_cancel ::
-        ReadableStreamBYOBReader -> Optional JSVal -> IO JSVal
+        "$1[\"cancel\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_cancel ::
+        ReadableStreamBYOBReader -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.cancel Mozilla ReadableStreamBYOBReader.cancel documentation> 
 cancel ::
@@ -72,8 +75,9 @@
          ReadableStreamBYOBReader -> Maybe reason -> m JSVal
 cancel self reason
   = liftIO
-      (mapM toJSVal reason >>=
-         \ reason' -> js_cancel self (maybeToOptional reason'))
+      ((mapM toJSVal reason >>=
+          \ reason' -> js_cancel self (maybeToOptional reason'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.cancel Mozilla ReadableStreamBYOBReader.cancel documentation> 
 cancel_ ::
@@ -93,9 +97,10 @@
 releaseLock self = liftIO (js_releaseLock self)
  
 foreign import javascript interruptible
-        "$1[\"closed\"].then($c);" js_getClosed ::
-        ReadableStreamBYOBReader -> IO Bool
+        "$1[\"closed\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getClosed :: ReadableStreamBYOBReader -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.closed Mozilla ReadableStreamBYOBReader.closed documentation> 
 getClosed :: (MonadIO m) => ReadableStreamBYOBReader -> m Bool
-getClosed self = liftIO (js_getClosed self)
+getClosed self
+  = liftIO ((js_getClosed self) >>= checkPromiseResult)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamDefaultReader.hs b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamDefaultReader.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamDefaultReader.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamDefaultReader.hs
@@ -40,20 +40,21 @@
   = liftIO (js_newReadableStreamDefaultReader stream)
  
 foreign import javascript interruptible
-        "$1[\"read\"]().then($c);" js_read ::
-        ReadableStreamDefaultReader -> IO JSVal
+        "$1[\"read\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_read :: ReadableStreamDefaultReader -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader.read Mozilla ReadableStreamDefaultReader.read documentation> 
 read :: (MonadIO m) => ReadableStreamDefaultReader -> m JSVal
-read self = liftIO (js_read self)
+read self = liftIO ((js_read self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader.read Mozilla ReadableStreamDefaultReader.read documentation> 
 read_ :: (MonadIO m) => ReadableStreamDefaultReader -> m ()
 read_ self = liftIO (void (js_read self))
  
 foreign import javascript interruptible
-        "$1[\"cancel\"]($2).then($c);" js_cancel ::
-        ReadableStreamDefaultReader -> Optional JSVal -> IO JSVal
+        "$1[\"cancel\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_cancel ::
+        ReadableStreamDefaultReader -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader.cancel Mozilla ReadableStreamDefaultReader.cancel documentation> 
 cancel ::
@@ -61,8 +62,9 @@
          ReadableStreamDefaultReader -> Maybe reason -> m JSVal
 cancel self reason
   = liftIO
-      (mapM toJSVal reason >>=
-         \ reason' -> js_cancel self (maybeToOptional reason'))
+      ((mapM toJSVal reason >>=
+          \ reason' -> js_cancel self (maybeToOptional reason'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader.cancel Mozilla ReadableStreamDefaultReader.cancel documentation> 
 cancel_ ::
@@ -82,9 +84,10 @@
 releaseLock self = liftIO (js_releaseLock self)
  
 foreign import javascript interruptible
-        "$1[\"closed\"].then($c);" js_getClosed ::
-        ReadableStreamDefaultReader -> IO Bool
+        "$1[\"closed\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getClosed :: ReadableStreamDefaultReader -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader.closed Mozilla ReadableStreamDefaultReader.closed documentation> 
 getClosed :: (MonadIO m) => ReadableStreamDefaultReader -> m Bool
-getClosed self = liftIO (js_getClosed self)
+getClosed self
+  = liftIO ((js_getClosed self) >>= checkPromiseResult)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamSource.hs b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamSource.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamSource.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/ReadableStreamSource.hs
@@ -28,24 +28,28 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"start\"]($2).then($c);" js_start ::
-        ReadableStreamSource -> ReadableStreamDefaultController -> IO ()
+        "$1[\"start\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_start ::
+        ReadableStreamSource -> ReadableStreamDefaultController -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamSource.start Mozilla ReadableStreamSource.start documentation> 
 start ::
       (MonadIO m) =>
         ReadableStreamSource -> ReadableStreamDefaultController -> m ()
-start self controller = liftIO (js_start self controller)
+start self controller
+  = liftIO ((js_start self controller) >>= maybeThrowPromiseRejected)
  
 foreign import javascript interruptible
-        "$1[\"pull\"]($2).then($c);" js_pull ::
-        ReadableStreamSource -> ReadableStreamDefaultController -> IO ()
+        "$1[\"pull\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_pull ::
+        ReadableStreamSource -> ReadableStreamDefaultController -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamSource.pull Mozilla ReadableStreamSource.pull documentation> 
 pull ::
      (MonadIO m) =>
        ReadableStreamSource -> ReadableStreamDefaultController -> m ()
-pull self controller = liftIO (js_pull self controller)
+pull self controller
+  = liftIO ((js_pull self controller) >>= maybeThrowPromiseRejected)
  
 foreign import javascript unsafe "$1[\"cancel\"]($2)" js_cancel ::
         ReadableStreamSource -> JSVal -> IO ()
diff --git a/src/GHCJS/DOM/JSFFI/Generated/Response.hs b/src/GHCJS/DOM/JSFFI/Generated/Response.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/Response.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/Response.hs
@@ -64,56 +64,62 @@
       (void (js_redirect self (toJSString url) (maybeToOptional status)))
  
 foreign import javascript interruptible
-        "$1[\"arrayBuffer\"]().then($c);" js_arrayBuffer ::
-        Response -> IO ArrayBuffer
+        "$1[\"arrayBuffer\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_arrayBuffer :: Response -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.arrayBuffer Mozilla Response.arrayBuffer documentation> 
 arrayBuffer :: (MonadIO m) => Response -> m ArrayBuffer
-arrayBuffer self = liftIO (js_arrayBuffer self)
+arrayBuffer self
+  = liftIO ((js_arrayBuffer self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.arrayBuffer Mozilla Response.arrayBuffer documentation> 
 arrayBuffer_ :: (MonadIO m) => Response -> m ()
 arrayBuffer_ self = liftIO (void (js_arrayBuffer self))
  
 foreign import javascript interruptible
-        "$1[\"blob\"]().then($c);" js_blob :: Response -> IO Blob
+        "$1[\"blob\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_blob :: Response -> IO (JSVal, Blob)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.blob Mozilla Response.blob documentation> 
 blob :: (MonadIO m) => Response -> m Blob
-blob self = liftIO (js_blob self)
+blob self = liftIO ((js_blob self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.blob Mozilla Response.blob documentation> 
 blob_ :: (MonadIO m) => Response -> m ()
 blob_ self = liftIO (void (js_blob self))
  
 foreign import javascript interruptible
-        "$1[\"formData\"]().then($c);" js_formData :: Response -> IO Blob
+        "$1[\"formData\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_formData :: Response -> IO (JSVal, Blob)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.formData Mozilla Response.formData documentation> 
 formData :: (MonadIO m) => Response -> m Blob
-formData self = liftIO (js_formData self)
+formData self = liftIO ((js_formData self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.formData Mozilla Response.formData documentation> 
 formData_ :: (MonadIO m) => Response -> m ()
 formData_ self = liftIO (void (js_formData self))
  
 foreign import javascript interruptible
-        "$1[\"json\"]().then($c);" js_json :: Response -> IO JSVal
+        "$1[\"json\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_json :: Response -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.json Mozilla Response.json documentation> 
 json :: (MonadIO m) => Response -> m JSVal
-json self = liftIO (js_json self)
+json self = liftIO ((js_json self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.json Mozilla Response.json documentation> 
 json_ :: (MonadIO m) => Response -> m ()
 json_ self = liftIO (void (js_json self))
  
 foreign import javascript interruptible
-        "$1[\"text\"]().then($c);" js_text :: Response -> IO JSString
+        "$1[\"text\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_text :: Response -> IO (JSVal, JSString)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.text Mozilla Response.text documentation> 
 text :: (MonadIO m, FromJSString result) => Response -> m result
-text self = liftIO (fromJSString <$> (js_text self))
+text self
+  = liftIO (fromJSString <$> ((js_text self) >>= checkPromiseResult))
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Response.text Mozilla Response.text documentation> 
 text_ :: (MonadIO m) => Response -> m ()
diff --git a/src/GHCJS/DOM/JSFFI/Generated/SubtleCrypto.hs b/src/GHCJS/DOM/JSFFI/Generated/SubtleCrypto.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/SubtleCrypto.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/SubtleCrypto.hs
@@ -33,8 +33,10 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"encrypt\"]($2, $3, $4).\nthen($c);" js_encrypt ::
-        SubtleCrypto -> JSString -> CryptoKey -> BufferSource -> IO JSVal
+        "$1[\"encrypt\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_encrypt ::
+        SubtleCrypto ->
+          JSString -> CryptoKey -> BufferSource -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.encrypt Mozilla WebKitSubtleCrypto.encrypt documentation> 
 encrypt ::
@@ -42,7 +44,9 @@
           SubtleCrypto -> algorithm -> CryptoKey -> data' -> m JSVal
 encrypt self algorithm key data'
   = liftIO
-      (js_encrypt self (toJSString algorithm) key (toBufferSource data'))
+      ((js_encrypt self (toJSString algorithm) key
+          (toBufferSource data'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.encrypt Mozilla WebKitSubtleCrypto.encrypt documentation> 
 encrypt_ ::
@@ -55,8 +59,10 @@
             (toBufferSource data')))
  
 foreign import javascript interruptible
-        "$1[\"decrypt\"]($2, $3, $4).\nthen($c);" js_decrypt ::
-        SubtleCrypto -> JSString -> CryptoKey -> BufferSource -> IO JSVal
+        "$1[\"decrypt\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_decrypt ::
+        SubtleCrypto ->
+          JSString -> CryptoKey -> BufferSource -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.decrypt Mozilla WebKitSubtleCrypto.decrypt documentation> 
 decrypt ::
@@ -64,7 +70,9 @@
           SubtleCrypto -> algorithm -> CryptoKey -> data' -> m JSVal
 decrypt self algorithm key data'
   = liftIO
-      (js_decrypt self (toJSString algorithm) key (toBufferSource data'))
+      ((js_decrypt self (toJSString algorithm) key
+          (toBufferSource data'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.decrypt Mozilla WebKitSubtleCrypto.decrypt documentation> 
 decrypt_ ::
@@ -77,8 +85,10 @@
             (toBufferSource data')))
  
 foreign import javascript interruptible
-        "$1[\"sign\"]($2, $3, $4).then($c);" js_sign ::
-        SubtleCrypto -> JSString -> CryptoKey -> BufferSource -> IO JSVal
+        "$1[\"sign\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_sign ::
+        SubtleCrypto ->
+          JSString -> CryptoKey -> BufferSource -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.sign Mozilla WebKitSubtleCrypto.sign documentation> 
 sign ::
@@ -86,7 +96,8 @@
        SubtleCrypto -> algorithm -> CryptoKey -> data' -> m JSVal
 sign self algorithm key data'
   = liftIO
-      (js_sign self (toJSString algorithm) key (toBufferSource data'))
+      ((js_sign self (toJSString algorithm) key (toBufferSource data'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.sign Mozilla WebKitSubtleCrypto.sign documentation> 
 sign_ ::
@@ -98,9 +109,11 @@
          (js_sign self (toJSString algorithm) key (toBufferSource data')))
  
 foreign import javascript interruptible
-        "$1[\"verify\"]($2, $3, $4, $5).\nthen($c);" js_verify ::
+        "$1[\"verify\"]($2, $3, $4, $5).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_verify ::
         SubtleCrypto ->
-          JSString -> CryptoKey -> BufferSource -> BufferSource -> IO JSVal
+          JSString ->
+            CryptoKey -> BufferSource -> BufferSource -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation> 
 verify ::
@@ -110,9 +123,10 @@
            algorithm -> CryptoKey -> signature -> data' -> m JSVal
 verify self algorithm key signature data'
   = liftIO
-      (js_verify self (toJSString algorithm) key
-         (toBufferSource signature)
-         (toBufferSource data'))
+      ((js_verify self (toJSString algorithm) key
+          (toBufferSource signature)
+          (toBufferSource data'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation> 
 verify_ ::
@@ -128,8 +142,9 @@
             (toBufferSource data')))
  
 foreign import javascript interruptible
-        "$1[\"digest\"]($2, $3).then($c);" js_digest ::
-        SubtleCrypto -> JSString -> BufferSource -> IO JSVal
+        "$1[\"digest\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_digest ::
+        SubtleCrypto -> JSString -> BufferSource -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.digest Mozilla WebKitSubtleCrypto.digest documentation> 
 digest ::
@@ -137,7 +152,8 @@
          SubtleCrypto -> algorithm -> data' -> m JSVal
 digest self algorithm data'
   = liftIO
-      (js_digest self (toJSString algorithm) (toBufferSource data'))
+      ((js_digest self (toJSString algorithm) (toBufferSource data')) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.digest Mozilla WebKitSubtleCrypto.digest documentation> 
 digest_ ::
@@ -149,10 +165,11 @@
          (js_digest self (toJSString algorithm) (toBufferSource data')))
  
 foreign import javascript interruptible
-        "$1[\"deriveKey\"]($2, $3, $4, $5,\n$6).\nthen($c);" js_deriveKey
-        ::
+        "$1[\"deriveKey\"]($2, $3, $4, $5,\n$6).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_deriveKey ::
         SubtleCrypto ->
-          JSString -> CryptoKey -> JSString -> Bool -> JSVal -> IO JSVal
+          JSString ->
+            CryptoKey -> JSString -> Bool -> JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.deriveKey Mozilla WebKitSubtleCrypto.deriveKey documentation> 
 deriveKey ::
@@ -163,12 +180,13 @@
 deriveKey self algorithm baseKey derivedKeyType extractable
   keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_deriveKey self (toJSString algorithm) baseKey
-             (toJSString derivedKeyType)
-             extractable
-             keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_deriveKey self (toJSString algorithm) baseKey
+              (toJSString derivedKeyType)
+              extractable
+              keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.deriveKey Mozilla WebKitSubtleCrypto.deriveKey documentation> 
 deriveKey_ ::
@@ -188,15 +206,19 @@
                 keyUsages'))
  
 foreign import javascript interruptible
-        "$1[\"deriveBits\"]($2, $3, $4).\nthen($c);" js_deriveBits ::
-        SubtleCrypto -> JSString -> CryptoKey -> Word -> IO ArrayBuffer
+        "$1[\"deriveBits\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_deriveBits ::
+        SubtleCrypto ->
+          JSString -> CryptoKey -> Word -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.deriveBits Mozilla WebKitSubtleCrypto.deriveBits documentation> 
 deriveBits ::
            (MonadIO m, ToJSString algorithm) =>
              SubtleCrypto -> algorithm -> CryptoKey -> Word -> m ArrayBuffer
 deriveBits self algorithm baseKey length
-  = liftIO (js_deriveBits self (toJSString algorithm) baseKey length)
+  = liftIO
+      ((js_deriveBits self (toJSString algorithm) baseKey length) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.deriveBits Mozilla WebKitSubtleCrypto.deriveBits documentation> 
 deriveBits_ ::
@@ -207,8 +229,9 @@
       (void (js_deriveBits self (toJSString algorithm) baseKey length))
  
 foreign import javascript interruptible
-        "$1[\"generateKey\"]($2, $3, $4).\nthen($c);" js_generateKey ::
-        SubtleCrypto -> JSString -> Bool -> JSVal -> IO JSVal
+        "$1[\"generateKey\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_generateKey ::
+        SubtleCrypto -> JSString -> Bool -> JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.generateKey Mozilla WebKitSubtleCrypto.generateKey documentation> 
 generateKey ::
@@ -216,9 +239,10 @@
               SubtleCrypto -> algorithm -> Bool -> [CryptoKeyUsage] -> m JSVal
 generateKey self algorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_generateKey self (toJSString algorithm) extractable keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_generateKey self (toJSString algorithm) extractable keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.generateKey Mozilla WebKitSubtleCrypto.generateKey documentation> 
 generateKey_ ::
@@ -232,10 +256,11 @@
               js_generateKey self (toJSString algorithm) extractable keyUsages'))
  
 foreign import javascript interruptible
-        "$1[\"importKey\"]($2, $3, $4, $5,\n$6).\nthen($c);" js_importKey
-        ::
+        "$1[\"importKey\"]($2, $3, $4, $5,\n$6).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_importKey ::
         SubtleCrypto ->
-          JSString -> KeyData -> JSString -> Bool -> JSVal -> IO CryptoKey
+          JSString ->
+            KeyData -> JSString -> Bool -> JSVal -> IO (JSVal, CryptoKey)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.importKey Mozilla WebKitSubtleCrypto.importKey documentation> 
 importKey ::
@@ -246,14 +271,15 @@
                 keyData -> algorithm -> Bool -> [CryptoKeyUsage] -> m CryptoKey
 importKey self format keyData algorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           toJSVal keyData >>=
-             \ keyData' ->
-               js_importKey self (toJSString format) (KeyData keyData')
-             (toJSString algorithm)
-             extractable
-             keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            toJSVal keyData >>=
+              \ keyData' ->
+                js_importKey self (toJSString format) (KeyData keyData')
+              (toJSString algorithm)
+              extractable
+              keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.importKey Mozilla WebKitSubtleCrypto.importKey documentation> 
 importKey_ ::
@@ -274,15 +300,18 @@
                 keyUsages'))
  
 foreign import javascript interruptible
-        "$1[\"exportKey\"]($2, $3).\nthen($c);" js_exportKey ::
-        SubtleCrypto -> JSString -> CryptoKey -> IO JSVal
+        "$1[\"exportKey\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_exportKey ::
+        SubtleCrypto -> JSString -> CryptoKey -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.exportKey Mozilla WebKitSubtleCrypto.exportKey documentation> 
 exportKey ::
           (MonadIO m, ToJSString format) =>
             SubtleCrypto -> format -> CryptoKey -> m JSVal
 exportKey self format key
-  = liftIO (js_exportKey self (toJSString format) key)
+  = liftIO
+      ((js_exportKey self (toJSString format) key) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.exportKey Mozilla WebKitSubtleCrypto.exportKey documentation> 
 exportKey_ ::
@@ -292,9 +321,10 @@
   = liftIO (void (js_exportKey self (toJSString format) key))
  
 foreign import javascript interruptible
-        "$1[\"wrapKey\"]($2, $3, $4, $5).\nthen($c);" js_wrapKey ::
+        "$1[\"wrapKey\"]($2, $3, $4, $5).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_wrapKey ::
         SubtleCrypto ->
-          JSString -> CryptoKey -> CryptoKey -> JSString -> IO JSVal
+          JSString -> CryptoKey -> CryptoKey -> JSString -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.wrapKey Mozilla WebKitSubtleCrypto.wrapKey documentation> 
 wrapKey ::
@@ -303,8 +333,9 @@
             format -> CryptoKey -> CryptoKey -> wrapAlgorithm -> m JSVal
 wrapKey self format key wrappingKey wrapAlgorithm
   = liftIO
-      (js_wrapKey self (toJSString format) key wrappingKey
-         (toJSString wrapAlgorithm))
+      ((js_wrapKey self (toJSString format) key wrappingKey
+          (toJSString wrapAlgorithm))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.wrapKey Mozilla WebKitSubtleCrypto.wrapKey documentation> 
 wrapKey_ ::
@@ -318,12 +349,13 @@
             (toJSString wrapAlgorithm)))
  
 foreign import javascript interruptible
-        "$1[\"unwrapKey\"]($2, $3, $4, $5,\n$6, $7, $8).\nthen($c);"
+        "$1[\"unwrapKey\"]($2, $3, $4, $5,\n$6, $7, $8).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_unwrapKey ::
         SubtleCrypto ->
           JSString ->
             BufferSource ->
-              CryptoKey -> JSString -> JSString -> Bool -> JSVal -> IO CryptoKey
+              CryptoKey ->
+                JSString -> JSString -> Bool -> JSVal -> IO (JSVal, CryptoKey)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.unwrapKey Mozilla WebKitSubtleCrypto.unwrapKey documentation> 
 unwrapKey ::
@@ -338,14 +370,15 @@
 unwrapKey self format wrappedKey unwrappingKey unwrapAlgorithm
   unwrappedKeyAlgorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_unwrapKey self (toJSString format) (toBufferSource wrappedKey)
-             unwrappingKey
-             (toJSString unwrapAlgorithm)
-             (toJSString unwrappedKeyAlgorithm)
-             extractable
-             keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_unwrapKey self (toJSString format) (toBufferSource wrappedKey)
+              unwrappingKey
+              (toJSString unwrapAlgorithm)
+              (toJSString unwrappedKeyAlgorithm)
+              extractable
+              keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.unwrapKey Mozilla WebKitSubtleCrypto.unwrapKey documentation> 
 unwrapKey_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/WebGPUCommandBuffer.hs b/src/GHCJS/DOM/JSFFI/Generated/WebGPUCommandBuffer.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/WebGPUCommandBuffer.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/WebGPUCommandBuffer.hs
@@ -92,9 +92,10 @@
   = liftIO (js_presentDrawable self drawable)
  
 foreign import javascript interruptible
-        "$1[\"completed\"].then($c);" js_getCompleted ::
-        WebGPUCommandBuffer -> IO ()
+        "$1[\"completed\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getCompleted :: WebGPUCommandBuffer -> IO JSVal
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGPUCommandBuffer.completed Mozilla WebGPUCommandBuffer.completed documentation> 
 getCompleted :: (MonadIO m) => WebGPUCommandBuffer -> m ()
-getCompleted self = liftIO (js_getCompleted self)
+getCompleted self
+  = liftIO ((js_getCompleted self) >>= maybeThrowPromiseRejected)
diff --git a/src/GHCJS/DOM/JSFFI/Generated/WebKitSubtleCrypto.hs b/src/GHCJS/DOM/JSFFI/Generated/WebKitSubtleCrypto.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/WebKitSubtleCrypto.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/WebKitSubtleCrypto.hs
@@ -31,9 +31,10 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"encrypt\"]($2, $3, $4).\nthen($c);" js_encrypt ::
+        "$1[\"encrypt\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_encrypt ::
         WebKitSubtleCrypto ->
-          JSString -> CryptoKey -> JSVal -> IO ArrayBuffer
+          JSString -> CryptoKey -> JSVal -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.encrypt Mozilla WebKitSubtleCrypto.encrypt documentation> 
 encrypt ::
@@ -42,8 +43,9 @@
             algorithm -> CryptoKey -> [data'] -> m ArrayBuffer
 encrypt self algorithm key data'
   = liftIO
-      (toJSVal data' >>=
-         \ data'' -> js_encrypt self (toJSString algorithm) key data'')
+      ((toJSVal data' >>=
+          \ data'' -> js_encrypt self (toJSString algorithm) key data'')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.encrypt Mozilla WebKitSubtleCrypto.encrypt documentation> 
 encrypt_ ::
@@ -56,9 +58,10 @@
             \ data'' -> js_encrypt self (toJSString algorithm) key data''))
  
 foreign import javascript interruptible
-        "$1[\"decrypt\"]($2, $3, $4).\nthen($c);" js_decrypt ::
+        "$1[\"decrypt\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_decrypt ::
         WebKitSubtleCrypto ->
-          JSString -> CryptoKey -> JSVal -> IO ArrayBuffer
+          JSString -> CryptoKey -> JSVal -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.decrypt Mozilla WebKitSubtleCrypto.decrypt documentation> 
 decrypt ::
@@ -67,8 +70,9 @@
             algorithm -> CryptoKey -> [data'] -> m ArrayBuffer
 decrypt self algorithm key data'
   = liftIO
-      (toJSVal data' >>=
-         \ data'' -> js_decrypt self (toJSString algorithm) key data'')
+      ((toJSVal data' >>=
+          \ data'' -> js_decrypt self (toJSString algorithm) key data'')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.decrypt Mozilla WebKitSubtleCrypto.decrypt documentation> 
 decrypt_ ::
@@ -81,9 +85,10 @@
             \ data'' -> js_decrypt self (toJSString algorithm) key data''))
  
 foreign import javascript interruptible
-        "$1[\"sign\"]($2, $3, $4).then($c);" js_sign ::
+        "$1[\"sign\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_sign ::
         WebKitSubtleCrypto ->
-          JSString -> CryptoKey -> JSVal -> IO ArrayBuffer
+          JSString -> CryptoKey -> JSVal -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.sign Mozilla WebKitSubtleCrypto.sign documentation> 
 sign ::
@@ -92,8 +97,9 @@
          algorithm -> CryptoKey -> [data'] -> m ArrayBuffer
 sign self algorithm key data'
   = liftIO
-      (toJSVal data' >>=
-         \ data'' -> js_sign self (toJSString algorithm) key data'')
+      ((toJSVal data' >>=
+          \ data'' -> js_sign self (toJSString algorithm) key data'')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.sign Mozilla WebKitSubtleCrypto.sign documentation> 
 sign_ ::
@@ -106,9 +112,11 @@
             \ data'' -> js_sign self (toJSString algorithm) key data''))
  
 foreign import javascript interruptible
-        "$1[\"verify\"]($2, $3, $4, $5).\nthen($c);" js_verify ::
+        "$1[\"verify\"]($2, $3, $4, $5).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_verify ::
         WebKitSubtleCrypto ->
-          JSString -> CryptoKey -> CryptoOperationData -> JSVal -> IO Bool
+          JSString ->
+            CryptoKey -> CryptoOperationData -> JSVal -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation> 
 verify ::
@@ -118,11 +126,12 @@
            algorithm -> CryptoKey -> signature -> [data'] -> m Bool
 verify self algorithm key signature data'
   = liftIO
-      (toJSVal data' >>=
-         \ data'' ->
-           js_verify self (toJSString algorithm) key
-             (toCryptoOperationData signature)
-             data'')
+      ((toJSVal data' >>=
+          \ data'' ->
+            js_verify self (toJSString algorithm) key
+              (toCryptoOperationData signature)
+              data'')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation> 
 verify_ ::
@@ -140,8 +149,9 @@
                 data''))
  
 foreign import javascript interruptible
-        "$1[\"digest\"]($2, $3).then($c);" js_digest ::
-        WebKitSubtleCrypto -> JSString -> JSVal -> IO ArrayBuffer
+        "$1[\"digest\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_digest ::
+        WebKitSubtleCrypto -> JSString -> JSVal -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.digest Mozilla WebKitSubtleCrypto.digest documentation> 
 digest ::
@@ -149,8 +159,9 @@
          WebKitSubtleCrypto -> algorithm -> [data'] -> m ArrayBuffer
 digest self algorithm data'
   = liftIO
-      (toJSVal data' >>=
-         \ data'' -> js_digest self (toJSString algorithm) data'')
+      ((toJSVal data' >>=
+          \ data'' -> js_digest self (toJSString algorithm) data'')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.digest Mozilla WebKitSubtleCrypto.digest documentation> 
 digest_ ::
@@ -163,9 +174,10 @@
             \ data'' -> js_digest self (toJSString algorithm) data''))
  
 foreign import javascript interruptible
-        "$1[\"generateKey\"]($2, $3, $4).\nthen($c);" js_generateKey ::
+        "$1[\"generateKey\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_generateKey ::
         WebKitSubtleCrypto ->
-          JSString -> Bool -> JSVal -> IO CryptoKeyOrKeyPair
+          JSString -> Bool -> JSVal -> IO (JSVal, CryptoKeyOrKeyPair)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.generateKey Mozilla WebKitSubtleCrypto.generateKey documentation> 
 generateKey ::
@@ -174,9 +186,10 @@
                 algorithm -> Bool -> [CryptoKeyUsage] -> m CryptoKeyOrKeyPair
 generateKey self algorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_generateKey self (toJSString algorithm) extractable keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_generateKey self (toJSString algorithm) extractable keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.generateKey Mozilla WebKitSubtleCrypto.generateKey documentation> 
 generateKey_ ::
@@ -190,12 +203,12 @@
               js_generateKey self (toJSString algorithm) extractable keyUsages'))
  
 foreign import javascript interruptible
-        "$1[\"importKey\"]($2, $3, $4, $5,\n$6).\nthen($c);" js_importKey
-        ::
+        "$1[\"importKey\"]($2, $3, $4, $5,\n$6).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_importKey ::
         WebKitSubtleCrypto ->
           JSString ->
             CryptoOperationData ->
-              Optional JSString -> Bool -> JSVal -> IO CryptoKey
+              Optional JSString -> Bool -> JSVal -> IO (JSVal, CryptoKey)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.importKey Mozilla WebKitSubtleCrypto.importKey documentation> 
 importKey ::
@@ -207,13 +220,14 @@
                   Maybe algorithm -> Bool -> [CryptoKeyUsage] -> m CryptoKey
 importKey self format keyData algorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_importKey self (toJSString format)
-             (toCryptoOperationData keyData)
-             (toOptionalJSString algorithm)
-             extractable
-             keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_importKey self (toJSString format)
+              (toCryptoOperationData keyData)
+              (toOptionalJSString algorithm)
+              extractable
+              keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.importKey Mozilla WebKitSubtleCrypto.importKey documentation> 
 importKey_ ::
@@ -234,15 +248,19 @@
                 keyUsages'))
  
 foreign import javascript interruptible
-        "$1[\"exportKey\"]($2, $3).\nthen($c);" js_exportKey ::
-        WebKitSubtleCrypto -> JSString -> CryptoKey -> IO ArrayBuffer
+        "$1[\"exportKey\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_exportKey ::
+        WebKitSubtleCrypto ->
+          JSString -> CryptoKey -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.exportKey Mozilla WebKitSubtleCrypto.exportKey documentation> 
 exportKey ::
           (MonadIO m, ToJSString format) =>
             WebKitSubtleCrypto -> format -> CryptoKey -> m ArrayBuffer
 exportKey self format key
-  = liftIO (js_exportKey self (toJSString format) key)
+  = liftIO
+      ((js_exportKey self (toJSString format) key) >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.exportKey Mozilla WebKitSubtleCrypto.exportKey documentation> 
 exportKey_ ::
@@ -252,9 +270,11 @@
   = liftIO (void (js_exportKey self (toJSString format) key))
  
 foreign import javascript interruptible
-        "$1[\"wrapKey\"]($2, $3, $4, $5).\nthen($c);" js_wrapKey ::
+        "$1[\"wrapKey\"]($2, $3, $4, $5).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_wrapKey ::
         WebKitSubtleCrypto ->
-          JSString -> CryptoKey -> CryptoKey -> JSString -> IO ArrayBuffer
+          JSString ->
+            CryptoKey -> CryptoKey -> JSString -> IO (JSVal, ArrayBuffer)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.wrapKey Mozilla WebKitSubtleCrypto.wrapKey documentation> 
 wrapKey ::
@@ -263,8 +283,9 @@
             format -> CryptoKey -> CryptoKey -> wrapAlgorithm -> m ArrayBuffer
 wrapKey self format key wrappingKey wrapAlgorithm
   = liftIO
-      (js_wrapKey self (toJSString format) key wrappingKey
-         (toJSString wrapAlgorithm))
+      ((js_wrapKey self (toJSString format) key wrappingKey
+          (toJSString wrapAlgorithm))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.wrapKey Mozilla WebKitSubtleCrypto.wrapKey documentation> 
 wrapKey_ ::
@@ -278,13 +299,14 @@
             (toJSString wrapAlgorithm)))
  
 foreign import javascript interruptible
-        "$1[\"unwrapKey\"]($2, $3, $4, $5,\n$6, $7, $8).\nthen($c);"
+        "$1[\"unwrapKey\"]($2, $3, $4, $5,\n$6, $7, $8).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
         js_unwrapKey ::
         WebKitSubtleCrypto ->
           JSString ->
             CryptoOperationData ->
               CryptoKey ->
-                JSString -> Optional JSString -> Bool -> JSVal -> IO CryptoKey
+                JSString ->
+                  Optional JSString -> Bool -> JSVal -> IO (JSVal, CryptoKey)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.unwrapKey Mozilla WebKitSubtleCrypto.unwrapKey documentation> 
 unwrapKey ::
@@ -300,15 +322,16 @@
 unwrapKey self format wrappedKey unwrappingKey unwrapAlgorithm
   unwrappedKeyAlgorithm extractable keyUsages
   = liftIO
-      (toJSVal keyUsages >>=
-         \ keyUsages' ->
-           js_unwrapKey self (toJSString format)
-             (toCryptoOperationData wrappedKey)
-             unwrappingKey
-             (toJSString unwrapAlgorithm)
-             (toOptionalJSString unwrappedKeyAlgorithm)
-             extractable
-             keyUsages')
+      ((toJSVal keyUsages >>=
+          \ keyUsages' ->
+            js_unwrapKey self (toJSString format)
+              (toCryptoOperationData wrappedKey)
+              unwrappingKey
+              (toJSString unwrapAlgorithm)
+              (toOptionalJSString unwrappedKeyAlgorithm)
+              extractable
+              keyUsages')
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitSubtleCrypto.unwrapKey Mozilla WebKitSubtleCrypto.unwrapKey documentation> 
 unwrapKey_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/Window.hs b/src/GHCJS/DOM/JSFFI/Generated/Window.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/Window.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/Window.hs
@@ -163,8 +163,9 @@
   = liftIO (void (js_encodeURIComponent self (toJSString uri)))
  
 foreign import javascript interruptible
-        "$1[\"fetch\"]($2, $3).then($c);" js_fetch ::
-        Window -> JSVal -> Optional RequestInit -> IO Response
+        "$1[\"fetch\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_fetch ::
+        Window -> JSVal -> Optional RequestInit -> IO (JSVal, Response)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Window.fetch Mozilla Window.fetch documentation> 
 fetch ::
@@ -172,8 +173,9 @@
         Window -> input -> Maybe RequestInit -> m Response
 fetch self input init
   = liftIO
-      (toJSVal input >>= \ input' -> js_fetch self input'
-         (maybeToOptional init))
+      ((toJSVal input >>= \ input' -> js_fetch self input'
+          (maybeToOptional init))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/Window.fetch Mozilla Window.fetch documentation> 
 fetch_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/WorkerGlobalScope.hs b/src/GHCJS/DOM/JSFFI/Generated/WorkerGlobalScope.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/WorkerGlobalScope.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/WorkerGlobalScope.hs
@@ -30,8 +30,10 @@
 import GHCJS.DOM.JSFFI.Generated.Enums
  
 foreign import javascript interruptible
-        "$1[\"fetch\"]($2, $3).then($c);" js_fetch ::
-        WorkerGlobalScope -> JSVal -> Optional RequestInit -> IO Response
+        "$1[\"fetch\"]($2, $3).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_fetch ::
+        WorkerGlobalScope ->
+          JSVal -> Optional RequestInit -> IO (JSVal, Response)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope.fetch Mozilla WorkerGlobalScope.fetch documentation> 
 fetch ::
@@ -39,9 +41,10 @@
         self -> input -> Maybe RequestInit -> m Response
 fetch self input init
   = liftIO
-      (toJSVal input >>=
-         \ input' -> js_fetch (toWorkerGlobalScope self) input'
-         (maybeToOptional init))
+      ((toJSVal input >>=
+          \ input' -> js_fetch (toWorkerGlobalScope self) input'
+          (maybeToOptional init))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope.fetch Mozilla WorkerGlobalScope.fetch documentation> 
 fetch_ ::
diff --git a/src/GHCJS/DOM/JSFFI/Generated/WritableStream.hs b/src/GHCJS/DOM/JSFFI/Generated/WritableStream.hs
--- a/src/GHCJS/DOM/JSFFI/Generated/WritableStream.hs
+++ b/src/GHCJS/DOM/JSFFI/Generated/WritableStream.hs
@@ -36,8 +36,8 @@
 newWritableStream = liftIO (js_newWritableStream)
  
 foreign import javascript interruptible
-        "$1[\"abort\"]($2).then($c);" js_abort ::
-        WritableStream -> Optional JSVal -> IO JSVal
+        "$1[\"abort\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_abort :: WritableStream -> Optional JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.abort Mozilla WritableStream.abort documentation> 
 abort ::
@@ -45,8 +45,9 @@
         WritableStream -> Maybe reason -> m JSVal
 abort self reason
   = liftIO
-      (mapM toJSVal reason >>=
-         \ reason' -> js_abort self (maybeToOptional reason'))
+      ((mapM toJSVal reason >>=
+          \ reason' -> js_abort self (maybeToOptional reason'))
+         >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.abort Mozilla WritableStream.abort documentation> 
 abort_ ::
@@ -59,25 +60,28 @@
             \ reason' -> js_abort self (maybeToOptional reason')))
  
 foreign import javascript interruptible
-        "$1[\"close\"]().then($c);" js_close :: WritableStream -> IO JSVal
+        "$1[\"close\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_close :: WritableStream -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.close Mozilla WritableStream.close documentation> 
 close :: (MonadIO m) => WritableStream -> m JSVal
-close self = liftIO (js_close self)
+close self = liftIO ((js_close self) >>= checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.close Mozilla WritableStream.close documentation> 
 close_ :: (MonadIO m) => WritableStream -> m ()
 close_ self = liftIO (void (js_close self))
  
 foreign import javascript interruptible
-        "$1[\"write\"]($2).then($c);" js_write ::
-        WritableStream -> JSVal -> IO JSVal
+        "$1[\"write\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_write :: WritableStream -> JSVal -> IO (JSVal, JSVal)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.write Mozilla WritableStream.write documentation> 
 write ::
       (MonadIO m, ToJSVal chunk) => WritableStream -> chunk -> m JSVal
 write self chunk
-  = liftIO (toJSVal chunk >>= \ chunk' -> js_write self chunk')
+  = liftIO
+      ((toJSVal chunk >>= \ chunk' -> js_write self chunk') >>=
+         checkPromiseResult)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.write Mozilla WritableStream.write documentation> 
 write_ ::
@@ -87,19 +91,21 @@
       (void (toJSVal chunk >>= \ chunk' -> js_write self chunk'))
  
 foreign import javascript interruptible
-        "$1[\"closed\"].then($c);" js_getClosed ::
-        WritableStream -> IO Bool
+        "$1[\"closed\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getClosed :: WritableStream -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.closed Mozilla WritableStream.closed documentation> 
 getClosed :: (MonadIO m) => WritableStream -> m Bool
-getClosed self = liftIO (js_getClosed self)
+getClosed self
+  = liftIO ((js_getClosed self) >>= checkPromiseResult)
  
 foreign import javascript interruptible
-        "$1[\"ready\"].then($c);" js_getReady :: WritableStream -> IO Bool
+        "$1[\"ready\"].then(function(s) { $c(null, s);}, function(e) { $c(e, null);});"
+        js_getReady :: WritableStream -> IO (JSVal, Bool)
 
 -- | <https://developer.mozilla.org/en-US/docs/Web/API/WritableStream.ready Mozilla WritableStream.ready documentation> 
 getReady :: (MonadIO m) => WritableStream -> m Bool
-getReady self = liftIO (js_getReady self)
+getReady self = liftIO ((js_getReady self) >>= checkPromiseResult)
  
 foreign import javascript unsafe "$1[\"state\"]" js_getState ::
         WritableStream -> IO JSString
diff --git a/src/GHCJS/DOM/Types.hs b/src/GHCJS/DOM/Types.hs
--- a/src/GHCJS/DOM/Types.hs
+++ b/src/GHCJS/DOM/Types.hs
@@ -40,6 +40,8 @@
 
   , Function(Function), unFunction, IsFunction, toFunction, noFunction
 
+  , PromiseRejected(..), noPromiseRejected, maybeThrowPromiseRejected, checkPromiseResult
+
   -- * Callbacks
   , AudioBufferCallback(..), noAudioBufferCallback
   , BlobCallback(..), noBlobCallback
@@ -953,7 +955,8 @@
 import Data.Coerce (coerce, Coercible)
 import Data.Monoid ((<>))
 import Data.Typeable (Typeable)
-import Control.Exception (Exception(..))
+import Control.Monad (unless)
+import Control.Exception (throwIO, Exception(..))
 #if MIN_VERSION_base(4,9,0)
 import GHC.Stack (HasCallStack)
 #else
@@ -1268,6 +1271,14 @@
 noPromiseRejected :: Maybe PromiseRejected
 noPromiseRejected = Nothing
 {-# INLINE noPromiseRejected #-}
+
+maybeThrowPromiseRejected :: JSVal -> IO ()
+maybeThrowPromiseRejected e = unless (isNull e) $ throwIO (PromiseRejected e)
+{-# INLINE maybeThrowPromiseRejected #-}
+
+checkPromiseResult :: (JSVal, a) -> IO a
+checkPromiseResult (e, a) = maybeThrowPromiseRejected e >> return a
+{-# INLINE checkPromiseResult #-}
 
 instance Show PromiseRejected where
     show _ = "A promise was rejected"
