fix(mcp): wrap attachment creator lookup errors

This commit is contained in:
memoclaw 2026-03-25 09:10:18 +08:00
parent 4b6f80596a
commit c53a77b4ba
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ type attachmentJSON struct {
func storeAttachmentToJSON(ctx context.Context, stores *store.Store, a *store.Attachment) (attachmentJSON, error) {
creator, err := lookupUsername(ctx, stores, a.CreatorID)
if err != nil {
return attachmentJSON{}, err
return attachmentJSON{}, errors.Wrap(err, "lookup attachment creator username")
}
j := attachmentJSON{
Name: "attachments/" + a.UID,
@ -60,7 +60,7 @@ func storeAttachmentToJSON(ctx context.Context, stores *store.Store, a *store.At
func storeAttachmentToJSONWithUsernames(a *store.Attachment, usernamesByID map[int32]string) (attachmentJSON, error) {
creator, err := lookupUsernameFromCache(usernamesByID, a.CreatorID)
if err != nil {
return attachmentJSON{}, err
return attachmentJSON{}, errors.Wrap(err, "lookup attachment creator username from cache")
}
j := attachmentJSON{
Name: "attachments/" + a.UID,