error handling

This commit is contained in:
nquidox 2025-10-26 19:53:32 +03:00
parent e90852cc95
commit a3fbd3b8e0

View file

@ -44,6 +44,9 @@ func (s *Service) Upload(ctx context.Context, bucket, object string, reader io.R
func (s *Service) GetPublicLink(ctx context.Context, bucket, object string) (string, string, error) {
stat, err := s.client.StatObject(ctx, bucket, object, minio.StatObjectOptions{})
if err != nil {
if err.Error() == minio.ToErrorResponse(err).Error() {
return "", "", nil
}
log.WithFields(log.Fields{
"error": err,
"key": bucket + "/" + object,