diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-03-08 23:02:44 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-03-08 23:02:44 +0100 |
| commit | 9e8ed9ef479ca2084d9e34edfda0a99be34dbdb5 (patch) | |
| tree | a07542caa4dfc3ccd2fe058f27ccadf3a459e91a /bulk.go | |
| parent | 0a9bb149419c4df0be820f2cb72c8cc7e3332c68 (diff) | |
| download | go-schwift-9e8ed9ef479ca2084d9e34edfda0a99be34dbdb5.tar.gz | |
generalize BulkUploadError into BulkError
For use in Account.BulkDelete().
Diffstat (limited to 'bulk.go')
| -rw-r--r-- | bulk.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -56,7 +56,7 @@ const ( //exceeded in the middle of the archive extraction). // //If not nil, the error return value is *usually* an instance of -//schwift.BulkUploadError. +//BulkError. // //This operation returns (0, ErrNotSupported) if the server does not support //bulk-uploading. @@ -114,9 +114,9 @@ func (a *Account) BulkUpload(uploadPath string, format BulkUploadFormat, content return 0, err } - //parse `result` into type BulkUploadError - bulkErr := BulkUploadError{ - ArchiveError: result.ResponseBody, + //parse `result` into type BulkError + bulkErr := BulkError{ + OverallError: result.ResponseBody, } bulkErr.StatusCode, err = parseResponseStatus(result.ResponseStatus) if err != nil { @@ -141,8 +141,8 @@ func (a *Account) BulkUpload(uploadPath string, format BulkUploadFormat, content }) } - //is BulkUploadError really an error? - if len(bulkErr.ObjectErrors) == 0 && bulkErr.ArchiveError == "" && bulkErr.StatusCode >= 200 && bulkErr.StatusCode < 300 { + //is BulkError really an error? + if len(bulkErr.ObjectErrors) == 0 && bulkErr.OverallError == "" && bulkErr.StatusCode >= 200 && bulkErr.StatusCode < 300 { return result.NumberFilesCreated, nil } return result.NumberFilesCreated, bulkErr |
