             try self.checkSavingSafetyForConverting(content: content, encoding: encoding)
             
         } catch let error {
-            self.recoverBlock = completionHandler
-            self.presentError(error,
-                              modalFor: self.windowForSheet!,
-                              delegate: self,
-                              didPresent: #selector(didPresentErrorWithRecovery(didRecover:block:)),
-                              contextInfo: nil)
+            self.presentErrorAsSheet(error, recoveryHandler: completionHandler)
             return
         }
         

        let encodingName = String.localizedName(of: encoding, withUTF8BOM: withUTF8BOM)
        
        // ask lossy
        guard !askLossy || self.string.canBeConverted(to: encoding) else {
            let error = EncodingError(kind: .lossyEncodingConversion, encoding: encoding, withUTF8BOM: withUTF8BOM, attempter: self)
            
            if let window = self.windowForSheet {
                window.attachedSheet?.orderOut(self)  // close previous sheet
                self.presentError(error, modalFor: window, delegate: nil, didPresent: nil, contextInfo: nil)
            } else {
                self.presentError(error)
            }
            return false
        }
        
        // register undo

                do {
                    try strongSelf.revert(toContentsOf: fileURL, ofType: fileType)
                } catch let error {
                    strongSelf.presentErrorAsSheet(error)
                }
            }
        }
