github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/internal/dispatch/errors.go (about) 1 package dispatch 2 3 import ( 4 "fmt" 5 ) 6 7 // MaxDepthExceededError is an error returned when the maximum depth for dispatching has been exceeded. 8 type MaxDepthExceededError struct { 9 error 10 11 // Request is the request that exceeded the maximum depth. 12 Request DispatchableRequest 13 } 14 15 // NewMaxDepthExceededError creates a new MaxDepthExceededError. 16 func NewMaxDepthExceededError(req DispatchableRequest) error { 17 return MaxDepthExceededError{ 18 fmt.Errorf("max depth exceeded: this usually indicates a recursive or too deep data dependency"), 19 req, 20 } 21 }