summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/attachment.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/dereferencing/attachment.go')
-rw-r--r--internal/federation/dereferencing/attachment.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/federation/dereferencing/attachment.go b/internal/federation/dereferencing/attachment.go
index 0c7005e23..36ff2734c 100644
--- a/internal/federation/dereferencing/attachment.go
+++ b/internal/federation/dereferencing/attachment.go
@@ -20,6 +20,7 @@ package dereferencing
import (
"context"
+ "errors"
"fmt"
"net/url"
@@ -60,7 +61,8 @@ func (d *deref) GetRemoteAttachment(ctx context.Context, requestingUsername stri
}
if err := d.db.Put(ctx, a); err != nil {
- if err != db.ErrAlreadyExists {
+ var alreadyExistsError *db.ErrAlreadyExists
+ if !errors.As(err, &alreadyExistsError) {
return nil, fmt.Errorf("GetRemoteAttachment: error inserting attachment: %s", err)
}
}