             didChangeValue(forKey: "isFinished")
         }
     }
-    
+
     /// Complete the operation
     ///
     /// This will result in the appropriate KVN of isFinished and isExecuting
     public func completeOperation() {
-        if isExecuting { _executing = false }
-        if !isFinished { _finished = true }
-    }
-    
+        if isExecuting { isExecuting = false }
+        if !isFinished { isFinished = true }
+    }
+
     override public func start() {
         if isCancelled {
-            _finished = true
+            isFinished = true
             return
         }
-        
-        _executing = true
-        
+
+        isExecuting = true
+
         main()
     }
-    
+
     override public func main() {
         fatalError("subclasses must override `main`")
     }
 }
 #else
 public class AsynchronousOperation : NSOperation {
-    
+
     override public var asynchronous: Bool { return true }
-    
+
     private let stateLock = NSLock()
-    
+
     private var _executing: Bool = false
     override private(set) public var executing: Bool {
         get {

                Log.Error.log("error = \(error)")
                success = false
            }
            
            finished?(success)
        }
        #endif
    }
    
    override func cancel() {
        if let task = task {
            task.cancel()
        }
        super.cancel()
    }
    
    override func main() {
        if let task = task { task.resume() }
    }
    
}

#if swift(>=3.0)
class AsynchronousOperation: Operation {
    
    override public var isAsynchronous: Bool { return true }
    
    private let stateLock = NSLock()
    
    private var _executing: Bool = false
    override private(set) public var isExecuting: Bool {
        get {

import Foundation

class RequestOperation: AsynchronousOperation {

    var task: URLSessionTask?
    var request: URLRequest?

    init(session: URLSession, request: URLRequest, finished: SentryEndpointRequestFinished? = nil) {
        super.init()

        self.request = request
        #if swift(>=3.0)
        task = session.dataTask(with: request) { [weak self] data, response, error in
            defer {
                self?.completeOperation()
            }

            var success = false

            // Returns success if we have data and 200 response code
            if let data = data, let response = response as? HTTPURLResponse {
                Log.Debug.log("status = \(response.statusCode)")
