             }
 
             guard let device = createCaptureDevice(mediaType) else {
-                let creationError = NSError(domain: CaptureDeviceAuthorizationErrorDomain, code: CaptureDeviceAuthorizationErrorCode.couldNotCreate.rawValue, userInfo: [NSLocalizedDescriptionKey: "Capture device for media type \(mediaType.stringConstant()) not available.", NSLocalizedFailureReasonErrorKey: "The user denied the request to access \(mediaType.stringConstant())."])
-                completion?(.failure(creationError))
+                completion?(.failure(creationError(mediaType: mediaType)))
                 return
             }
 

            return
        #else
            if currentlyAuthorized(forMediaType: mediaType) {
                completion?(.success(createCaptureDevice(mediaType)))
                return
            }


        return AVCaptureDevice.default(for: mediaType.stringConstant())
    }

    class func creationError(mediaType: MediaType) -> NSError {
        return NSError(
            domain: CaptureDeviceAuthorizationErrorDomain,
            code: CaptureDeviceAuthorizationErrorCode.couldNotCreate.rawValue,
            userInfo: [
                NSLocalizedDescriptionKey: "Capture device for media type \(mediaType.stringConstant()) not available.",
                NSLocalizedFailureReasonErrorKey: "The user denied the request to access \(mediaType.stringConstant())."
            ]
        )
    }

}

