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

Method FileOrErr

ent/metadata.go:52–61  ·  view source on GitHub ↗

FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

()

Source from the content-addressed store, hash-verified

50// FileOrErr returns the File value or an error if the edge
51// was not loaded in eager-loading, or loaded but was not found.
52func (e MetadataEdges) FileOrErr() (*File, error) {
53 if e.loadedTypes[0] {
54 if e.File == nil {
55 // Edge was loaded but was not found.
56 return nil, &NotFoundError{label: file.Label}
57 }
58 return e.File, nil
59 }
60 return nil, &NotLoadedError{edge: "file"}
61}
62
63// scanValues returns the types for scanning values from sql.Rows.
64func (*Metadata) scanValues(columns []string) ([]any, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected