MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / Aggregate

Method Aggregate

pkg/serializer/error.go:436–449  ·  view source on GitHub ↗

Aggregate aggregates the error and returns nil if there is no error; otherwise returns the error itself

()

Source from the content-addressed store, hash-verified

434// Aggregate aggregates the error and returns nil if there is no error;
435// otherwise returns the error itself
436func (e *AggregateError) Aggregate() error {
437 if len(e.errs) == 0 {
438 return nil
439 }
440
441 msg := "One or more operation failed"
442 if len(e.errs) == 1 {
443 for _, err := range e.errs {
444 msg = err.Error()
445 }
446 }
447
448 return NewError(CodeBatchOperationNotFullyCompleted, msg, e)
449}
450
451func (e *AggregateError) FormatFirstN(n int) string {
452 if len(e.errs) == 0 {

Callers 12

CreateDownloadTaskMethod · 0.95
CleanupFunction · 0.95
DeleteMethod · 0.95
SoftDeleteMethod · 0.95
DeleteMethod · 0.95
RestoreMethod · 0.95
MoveOrCopyMethod · 0.95
PatchMetadataMethod · 0.95
RecycleEntitiesMethod · 0.95
GetDirectLinkMethod · 0.95
GetEntityUrlsMethod · 0.95
ApplyStorageDiffMethod · 0.95

Calls 2

NewErrorFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected