(ctx context.Context, newAttachments updatedAttachments)
| 2352 | } |
| 2353 | |
| 2354 | func (db *DatabaseCollectionWithUser) addAttachments(ctx context.Context, newAttachments updatedAttachments) error { |
| 2355 | // Need to check and add attachments here to ensure the attachment is within size constraints |
| 2356 | err := db.setAttachments(ctx, newAttachments) |
| 2357 | if err != nil { |
| 2358 | if errors.Is(err, ErrAttachmentTooLarge) || err.Error() == "document value was too large" { |
| 2359 | err = base.HTTPErrorf(http.StatusRequestEntityTooLarge, "Attachment too large") |
| 2360 | } else { |
| 2361 | err = errors.Wrap(err, "Error adding attachment") |
| 2362 | } |
| 2363 | } |
| 2364 | return err |
| 2365 | } |
| 2366 | |
| 2367 | // assignSequence assigns a global sequence number from database. |
| 2368 | func (c *DatabaseCollectionWithUser) assignSequence(ctx context.Context, docSequence uint64, doc *Document, unusedSequences []uint64) ([]uint64, error) { |
no test coverage detected