MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / FirstX

Method FirstX

pkg/database/ent/alert_query.go:173–179  ·  view source on GitHub ↗

FirstX is like First, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

171
172// FirstX is like First, but panics if an error occurs.
173func (_q *AlertQuery) FirstX(ctx context.Context) *Alert {
174 node, err := _q.First(ctx)
175 if err != nil && !IsNotFound(err) {
176 panic(err)
177 }
178 return node
179}
180
181// FirstID returns the first Alert ID from the query.
182// Returns a *NotFoundError when no Alert ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected