error checking

This commit is contained in:
Andrea Spacca 2019-06-24 07:45:47 +02:00
parent 6fa94d6631
commit 4a1697ee60

View file

@ -152,6 +152,9 @@ func (s *S3Storage) Head(token string, filename string) (contentType string, con
// content type , content length // content type , content length
response, err := s.s3.HeadObject(headRequest) response, err := s.s3.HeadObject(headRequest)
if err != nil {
return
}
if response.ContentType != nil { if response.ContentType != nil {
contentType = *response.ContentType contentType = *response.ContentType
@ -188,6 +191,9 @@ func (s *S3Storage) Get(token string, filename string) (reader io.ReadCloser, co
} }
response, err := s.s3.GetObject(getRequest) response, err := s.s3.GetObject(getRequest)
if err != nil {
return
}
if response.ContentType != nil { if response.ContentType != nil {
contentType = *response.ContentType contentType = *response.ContentType