iOS 11 file-provider out-of-quota errors

I'm trying but failing to use the NSFileProviderErrorInsufficientQuota error code.


Setting uploadingError on items to something like:

let userInfo: [String:Any] = [NSURLErrorKey: NSURL(string: "https://my.domain.net/purchase-quota/")!,
                              NSLocalizedDescriptionKey: "Out of quota!"]
return NSError(domain: NSFileProviderError.errorDomain,
               code: NSFileProviderError.Code.insufficientQuota.rawValue,
               userInfo: userInfo)


In the Files app there is a little "Upload Error" beneath the filename, but there is no way for the user to find out anything more.


Looking through the "File Provider Enhancements from WWDC 2017" the speaker says that:

In a persistent error case, like, for example, the user's out of quota, 
what you need to do is tell the user, hey, you're out of quota. You got 
to go and buy more quota on our web page. And in that situation, basically
what you give us is a, an error that suggests a recovery option.


This hints at using recoveryAttempter on NSError and I tried something like:

let userInfo: [String:Any] = [NSRecoveryAttempterErrorKey: TestErrorRecovery(),
                              NSLocalizedRecoveryOptionsErrorKey: ["Retry", "Cancel"]]


This makes the Files app complain in the log that

Exception: decodeObjectForKey: class "Provider.TestErrorRecovery" not loaded or does not exist

probably because the NSError is transferred from one process to another.


It seems the File Provider framework has specific support for users being out of quota, but I cannot find any documentation or examples showing exactly how this can be used.


Anyone know how to actually do something sensible when the user is out of quota?