file.upload: fix error handling for multipart
handle error correctly in postWithMultipartResponse
Denys Smirnov authored 6 years ago
GitHub committed 6 years ago
91 | 91 | |
92 | 92 | func postWithMultipartResponse(path, filepath, fieldname string, values url.Values, intf interface{}, debug bool) error { |
93 | 93 | req, err := fileUploadReq(SLACK_API+path, filepath, fieldname, values) |
94 | if err != nil { | |
95 | return err | |
96 | } | |
94 | 97 | resp, err := HTTPClient.Do(req) |
95 | 98 | if err != nil { |
96 | 99 | return err |