Skip to content

toHttpResponse

toHttpResponse(error, options?): HttpResponse

Defined in: packages/pipeline-feature-flags/src/http.ts:22

The HTTP answer for a FeatureDisabledError: 403 Forbidden naming the flag, or with hideFeature a plain 404 Not Found that does not reveal the feature exists.

FeatureDisabledError

boolean

HttpResponse

const { status, body } = toHttpResponse(error, { hideFeature: true });
res.status(status).json(body);