[njs] Log error message if VM creation failed.

Dmitry Volyntsev xeioex at nginx.com
Thu Jun 22 16:28:41 UTC 2017


details:   http://hg.nginx.org/njs/rev/61feac0beeb3
branches:  
changeset: 374:61feac0beeb3
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Jun 22 18:52:47 2017 +0300
description:
Log error message if VM creation failed.

diffstat:

 nginx/ngx_http_js_module.c   |  1 +
 nginx/ngx_stream_js_module.c |  1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r 36947c6cb8c6 -r 61feac0beeb3 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Tue Jun 20 18:06:19 2017 +0300
+++ b/nginx/ngx_http_js_module.c	Thu Jun 22 18:52:47 2017 +0300
@@ -1323,6 +1323,7 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_
 
     jlcf->vm = njs_vm_create(mcp, &shared, &externals);
     if (jlcf->vm == NULL) {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "failed to create JS VM");
         return NGX_CONF_ERROR;
     }
 
diff -r 36947c6cb8c6 -r 61feac0beeb3 nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Tue Jun 20 18:06:19 2017 +0300
+++ b/nginx/ngx_stream_js_module.c	Thu Jun 22 18:52:47 2017 +0300
@@ -1033,6 +1033,7 @@ ngx_stream_js_include(ngx_conf_t *cf, ng
 
     jscf->vm = njs_vm_create(mcp, &shared, &externals);
     if (jscf->vm == NULL) {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "failed to create JS VM");
         return NGX_CONF_ERROR;
     }
 


More information about the nginx-devel mailing list