aboutsummaryrefslogtreecommitdiffstats
path: root/services/mailer/mail.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer/mail.go')
-rw-r--r--services/mailer/mail.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/mailer/mail.go b/services/mailer/mail.go
index f7e5b0c9f0..aa51cbdbcf 100644
--- a/services/mailer/mail.go
+++ b/services/mailer/mail.go
@@ -8,6 +8,7 @@ import (
"bytes"
"context"
"encoding/base64"
+ "errors"
"fmt"
"html/template"
"io"
@@ -117,7 +118,7 @@ func (b64embedder *mailAttachmentBase64Embedder) AttachmentSrcToBase64DataURI(ct
attachmentUUID, ok = strings.CutPrefix(parsedSrc.RepoSubPath, "/attachments/")
}
if !ok {
- return "", fmt.Errorf("not an attachment")
+ return "", errors.New("not an attachment")
}
}
attachment, err := repo_model.GetAttachmentByUUID(ctx, attachmentUUID)
@@ -126,10 +127,10 @@ func (b64embedder *mailAttachmentBase64Embedder) AttachmentSrcToBase64DataURI(ct
}
if attachment.RepoID != b64embedder.repo.ID {
- return "", fmt.Errorf("attachment does not belong to the repository")
+ return "", errors.New("attachment does not belong to the repository")
}
if attachment.Size+b64embedder.estimateSize > b64embedder.maxSize {
- return "", fmt.Errorf("total embedded images exceed max limit")
+ return "", errors.New("total embedded images exceed max limit")
}
fr, err := storage.Attachments.Open(attachment.RelativePath())
@@ -146,7 +147,7 @@ func (b64embedder *mailAttachmentBase64Embedder) AttachmentSrcToBase64DataURI(ct
mimeType := typesniffer.DetectContentType(content)
if !mimeType.IsImage() {
- return "", fmt.Errorf("not an image")
+ return "", errors.New("not an image")
}
encoded := base64.StdEncoding.EncodeToString(content)
> 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175