function errorResponse(error, res, destructor = null) {
	if (destructor !== null) destructor();

	res.status(error.code).json({
		err: error.err,
		msg: error.msg,
	});
}
Send error response to a client

@param {Object} error Object containing code, err, msg
@param {Object} res Express response object.
@param {function} [destructor] Optional function called before sending error to a client