feat(errors): custom error can be provided to middlewares