makeError = (error, errcode, statusCode) => {
            const message = typeof error == "object" ? error.message : error
            const err = typeof error == "object" ? error : new Error(message||"Unexpected Error")
            err.status = err.status || statusCode || 400;
            err.code = err.code || errcode || "unexpected_error"
            runtime.log.audit({
                event: "flows.setState",
                state: opts.state || "",
                error: errcode || "unexpected_error",
                message: err.code
            }, opts.req);
            return err
        }
Sets running state of runtime flows
@param {Object} opts
@param {Object} opts.req - the request to log (optional)
@param {User} opts.user - the user calling the api
@param {string} opts.state - the requested state. Valid values are "start" and "stop".
@return {Promise<Flow>} - the active flow configuration
@memberof @node-red/runtime_flows