mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-26 05:16:25 +02:00
lint: improve error handling
This commit is contained in:
parent
ef8aec77a9
commit
a81add5d96
6 changed files with 9 additions and 5 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"bytes"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
|
@ -36,7 +37,8 @@ func (c *cache) Get(key string) ([]byte, bool) {
|
|||
|
||||
resp, err := c.GetObject(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok && aerr.Code() != "NoSuchKey" {
|
||||
var aerr awserr.Error
|
||||
if errors.As(err, &aerr) && aerr.Code() != "NoSuchKey" {
|
||||
log.Printf("error fetching from s3: %v", aerr)
|
||||
}
|
||||
return nil, false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue