-
Notifications
You must be signed in to change notification settings - Fork 124
Description
I'm integrating TUSKit into the supabase-swift package for built-in support for resumable uploads. When creating an upload, if access controls are not configured correctly (or an invalid api key is provided), the TUSClient will return couldNotCreateFileOnServer
, with no other details. If I add the didReceive data
delegate method to SessionDataDelegate
and print the response, you'll see a much more informative response.
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
print(String(data: data, encoding: .utf8) ?? "No data")
}
In this case, I provided an invalid API key.
{"statusCode":"403","code":"AccessDenied","error":"Unauthorized","message":"Invalid Compact JWS"}
Similarly, uploading a duplicate file without x-upsert: true
will return a 409 and print The resource already exists
.
It would be helpful to consumers to provide the statusCode and body (if there is one) during this step to better diagnose upload issues.