[njs] Renaming njs_exception_error_create() with njs_error_fmt_new().

Dmitry Volyntsev xeioex at nginx.com
Mon Feb 4 08:33:54 UTC 2019


details:   https://hg.nginx.org/njs/rev/db4c9c8efff5
branches:  
changeset: 756:db4c9c8efff5
user:      hongzhidao <hongzhidao at gmail.com>
date:      Mon Feb 04 06:22:51 2019 +0800
description:
Renaming njs_exception_error_create() with njs_error_fmt_new().

diffstat:

 njs/njs_error.c |   5 ++---
 njs/njs_error.h |  18 +++++++++---------
 2 files changed, 11 insertions(+), 12 deletions(-)

diffs (56 lines):

diff -r 06e1b1790f9a -r db4c9c8efff5 njs/njs_error.c
--- a/njs/njs_error.c	Mon Feb 04 05:33:19 2019 +0800
+++ b/njs/njs_error.c	Mon Feb 04 06:22:51 2019 +0800
@@ -37,11 +37,10 @@ njs_error_new(njs_vm_t *vm, njs_value_ty
 
 
 void
-njs_exception_error_create(njs_vm_t *vm, njs_value_type_t type,
-    const char* fmt, ...)
+njs_error_fmt_new(njs_vm_t *vm, njs_value_type_t type, const char* fmt, ...)
 {
     va_list  args;
-    u_char   buf[256], *p;
+    u_char   buf[NXT_MAX_ERROR_STR], *p;
 
     p = buf;
 
diff -r 06e1b1790f9a -r db4c9c8efff5 njs/njs_error.h
--- a/njs/njs_error.h	Mon Feb 04 05:33:19 2019 +0800
+++ b/njs/njs_error.h	Mon Feb 04 06:22:51 2019 +0800
@@ -9,26 +9,26 @@
 
 
 #define njs_error(vm, fmt, ...)                                               \
-    njs_exception_error_create(vm, NJS_OBJECT_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_ERROR, fmt, ##__VA_ARGS__)
 #define njs_eval_error(vm, fmt, ...)                                          \
-    njs_exception_error_create(vm, NJS_OBJECT_EVAL_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_EVAL_ERROR, fmt, ##__VA_ARGS__)
 #define njs_internal_error(vm, fmt, ...)                                      \
-    njs_exception_error_create(vm, NJS_OBJECT_INTERNAL_ERROR, fmt,            \
+    njs_error_fmt_new(vm, NJS_OBJECT_INTERNAL_ERROR, fmt,            \
                                ##__VA_ARGS__)
 #define njs_range_error(vm, fmt, ...)                                         \
-    njs_exception_error_create(vm, NJS_OBJECT_RANGE_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_RANGE_ERROR, fmt, ##__VA_ARGS__)
 #define njs_reference_error(vm, fmt, ...)                                     \
-    njs_exception_error_create(vm, NJS_OBJECT_REF_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_REF_ERROR, fmt, ##__VA_ARGS__)
 #define njs_syntax_error(vm, fmt, ...)                                        \
-    njs_exception_error_create(vm, NJS_OBJECT_SYNTAX_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_SYNTAX_ERROR, fmt, ##__VA_ARGS__)
 #define njs_type_error(vm, fmt, ...)                                          \
-    njs_exception_error_create(vm, NJS_OBJECT_TYPE_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_TYPE_ERROR, fmt, ##__VA_ARGS__)
 #define njs_uri_error(vm, fmt, ...)                                           \
-    njs_exception_error_create(vm, NJS_OBJECT_URI_ERROR, fmt, ##__VA_ARGS__)
+    njs_error_fmt_new(vm, NJS_OBJECT_URI_ERROR, fmt, ##__VA_ARGS__)
 
 void njs_error_new(njs_vm_t *vm, njs_value_type_t type, u_char *start,
     size_t size);
-void njs_exception_error_create(njs_vm_t *vm, njs_value_type_t type,
+void njs_error_fmt_new(njs_vm_t *vm, njs_value_type_t type,
     const char* fmt, ...);
 
 void njs_memory_error(njs_vm_t *vm);


More information about the nginx-devel mailing list