function doInit()

in core/nodejsActionBase/src/service.js [162:184]


    function doInit(message) {
        if (message.env && typeof message.env == 'object') {
            Object.keys(message.env).forEach(k => {
                let val = message.env[k];
                if (typeof val !== 'object' || val == null) {
                    process.env[k] = val ? val.toString() : "";
                } else {
                    process.env[k] = JSON.stringify(val);
                }
            });
        }

        return initializeActionHandler(message)
            .then(handler => {
                userCodeRunner = new NodeActionRunner(handler);
            })
            // emit error to activation log then flush the logs as this is the end of the activation
            .catch(error => {
                console.error('Error during initialization:', error);
                writeMarkers();
                return Promise.reject(error);
            });
    }