function doInit()

in knative-build/runtimes/javascript/src/service.js [181:200]


    function doInit(message) {
        userCodeRunner = new NodeActionRunner();

        DEBUG.functionStart();
        DEBUG.dumpObject(message, 'message');
        return userCodeRunner.init(message).then(function(result) {
            // 'true' has no particular meaning here. The fact that the promise
            // is resolved successfully in itself carries the intended message
            // that initialization succeeded.
            DEBUG.functionEndSuccess('userCodeRunner.init() Success');
            return true;
        }).catch(function(error) {
            // emit error to activation log then flush the logs as this
            // is the end of the activation
            console.error('Error during initialization:', error);
            writeMarkers();
            DEBUG.functionEndError('userCodeRunner.init() Error: ' + error);
            return Promise.reject(error);
        });
    }