             // Before sending the logs, we need to read them from the file. This is done in a serial dispatch queue to prevent conflicts if the log file is simulatenously being written to.
             switch bufferLogFile {
             case FILE_ANALYTICS_SEND:
-                try dispatch_sync(Logger.analyticsFileIOQueue, block: { () -> () in
+                try dispatch_sync_throwable(Logger.analyticsFileIOQueue, block: { () -> () in
                     fileContents = try NSString(contentsOfFile: bufferLogFile, encoding: NSUTF8StringEncoding) as String
                 })
             case FILE_LOGGER_SEND:
-                try dispatch_sync(Logger.loggerFileIOQueue, block: { () -> () in
+                try dispatch_sync_throwable(Logger.loggerFileIOQueue, block: { () -> () in
                     fileContents = try NSString(contentsOfFile: bufferLogFile, encoding: NSUTF8StringEncoding) as String
                 })
             default:

    }
}

// TODO: When logging about file operations, record only the file name, not the whole path

// TODO: Refactor this entire file so that it is better organized and more readable. Consider using extensions.



    
    // Custom dispatch_sync that can incorporate throwable statements
    internal static func dispatch_sync_throwable(queue: dispatch_queue_t, block: () throws -> ()) throws {
        
        var error: ErrorType?
        try dispatch_sync(queue) {
