mejores errores
This commit is contained in:
parent
dff20d26ca
commit
46d587d685
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -29,10 +29,10 @@ func (fu FileURL) NeedsUpload() bool {
|
||||||
func (fu FileURL) UploadData() (string, io.Reader, error) {
|
func (fu FileURL) UploadData() (string, io.Reader, error) {
|
||||||
res, err := http.Get(string(fu))
|
res, err := http.Get(string(fu))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil, err
|
return "", nil, errors.Join(errors.New("error while uploading FileURL"), err)
|
||||||
}
|
}
|
||||||
if res.StatusCode != http.StatusOK {
|
if res.StatusCode != http.StatusOK {
|
||||||
return "", nil, errors.New(res.Status)
|
return "", nil, errors.New("error while uploading FileURL: " + res.Status)
|
||||||
}
|
}
|
||||||
return "url.mp4", res.Body, nil
|
return "url.mp4", res.Body, nil
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue