Replace bad file type error with constant
This commit is contained in:
parent
99262cf76c
commit
6c84cd1fbb
2 changed files with 7 additions and 1 deletions
2
bot.go
2
bot.go
|
@ -146,7 +146,7 @@ func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldna
|
|||
|
||||
ms.WriteReader(fieldname, f.Name, int64(len(data)), buf)
|
||||
default:
|
||||
return APIResponse{}, errors.New("bad file type")
|
||||
return APIResponse{}, errors.New(ErrBadFileType)
|
||||
}
|
||||
|
||||
method := fmt.Sprintf(APIEndpoint, bot.Token, endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue