Skip to content

Request to add underlyingError to TUSClientError.couldNotGetFileStatus #223

@andrewking1235

Description

@andrewking1235

Hi! I've been debugging errors in resuming uploads, and noticed that in TUSKit's StatusTask.swift line 101 is hiding an underlying error:

                            } catch let error as TUSClientError {
                                completed(.failure(error))
                            } catch {
                                completed(.failure(TUSClientError.couldNotGetFileStatus))
                            }

In my current case the error in that last catch is meaningful, and would be helpful to pass to our logging servers:

(lldb) po error
▿ TUSAPIError
  - underlyingError : Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=-4, NSUnderlyingError=0x3033e50e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4809DF01-5D04-4544-BF81-841BA2E4DBE0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <4809DF01-5D04-4544-BF81-841BA2E4DBE0>.<1>"
), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=<OUR DOMAIN>/mobile/media/tusupload/c5ce516de4794a3f99e57746aef1f578, NSErrorFailingURLKey=<OUR DOMAIN>/mobile/media/tusupload/c5ce516de4794a3f99e57746aef1f578, _kCFStreamErrorDomainKey=4}

Would it be possible to include either the TUSAPIError, or if you are trying not to expose that, it's own underlying network error?

Thanks!
Andrew

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions