UNPKG

@fastify/send

Version:

Better streaming static file server with Range and conditional-GET support

24 lines (18 loc) 443 B
'use strict' const createError = require('http-errors') /** * Create a HttpError object from simple arguments. * * @param {number} status * @param {Error|object} err * @private */ function createHttpError (status, err) { if (!err) { return createError(status) } return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err) } module.exports.createHttpError = createHttpError