Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Add generic invalidation error
Browse files Browse the repository at this point in the history
  • Loading branch information
supperspidey authored and Van Le Nguyen committed Aug 20, 2018
1 parent 1c6f7fb commit 139922e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion VimeoUpload/Descriptor System/DescriptorManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ open class DescriptorManager: NSObject
static let QueueName = "descriptor_manager.synchronization_queue"
static let ShareExtensionArchivePrefix = "share_extension"
static let ShareExtensionDescriptorDidSuspend = "ShareExtensionDescriptorDidSuspend"

struct InvalidationError
{
static let Domain = "BackgroundSessionInvalidationError"
static let Code = 1
static let LocalizedDescription = "A session object referring to the same background session has been invalidated and thus disconnected from the session."
}
}

// MARK:
Expand Down Expand Up @@ -198,7 +205,8 @@ open class DescriptorManager: NSObject
let theError: NSError?
if error != nil
{
theError = error as NSError
let userInfo = [NSLocalizedDescriptionKey: Constants.InvalidationError.LocalizedDescription]
theError = NSError(domain: Constants.InvalidationError.Domain, code: Constants.InvalidationError.Code, userInfo: userInfo)
}
else
{
Expand Down

0 comments on commit 139922e

Please sign in to comment.