Skip to content

Exception filters

dygo.FilterFor(func(e *store.ConflictError, host dygo.ArgumentsHost) {
errs.WriteJSON(host.HTTP().Response(), errs.ToBody(errs.Conflict(e.Error())))
})

FilterFor matches with errors.As, so wrapped errors are found. A recovered panic arrives as *dygo.PanicError. A filter that returns false (or a FilterFor that does not match) passes the error on; the default error writer is always last.