Skip to content

Commit e41beaa

Browse files
committed
fix: improve error message for invalid encoding type in DoMultiPartRequest
1 parent a530953 commit e41beaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httpclient/multipartrequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type UploadState struct {
6767
func (c *Client) DoMultiPartRequest(method, endpoint string, files map[string][]string, formDataFields map[string]string, fileContentTypes map[string]string, formDataPartHeaders map[string]http.Header, encodingType string, out interface{}) (*http.Response, error) {
6868
if encodingType != "byte" && encodingType != "base64" {
6969
c.Sugar.Errorw("Invalid encoding type specified", zap.String("encodingType", encodingType))
70-
return nil, fmt.Errorf("invalid encoding type: %s. Must be 'raw' or 'base64'", encodingType)
70+
return nil, fmt.Errorf("invalid encoding type: %s. Must be 'byte' for rawBytes or 'base64' for base64 encoded content", encodingType)
7171
}
7272

7373
if method != http.MethodPost && method != http.MethodPut {

0 commit comments

Comments
 (0)