nxt_ruby.c (1814:05a8e3eb6244) nxt_ruby.c (1905:d66a5f909497)
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

--- 1055 unchanged lines hidden (view full) ---

1064
1065 nxt_unit_req_log(req, level, "Ruby: %s", desc);
1066
1067 err = rb_errinfo();
1068 if (nxt_slow_path(err == Qnil)) {
1069 return;
1070 }
1071
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

--- 1055 unchanged lines hidden (view full) ---

1064
1065 nxt_unit_req_log(req, level, "Ruby: %s", desc);
1066
1067 err = rb_errinfo();
1068 if (nxt_slow_path(err == Qnil)) {
1069 return;
1070 }
1071
1072 eclass = rb_class_name(rb_class_of(err));
1073
1074 msg = rb_funcall(err, rb_intern("message"), 0);
1072 ary = rb_funcall(err, rb_intern("backtrace"), 0);
1075 ary = rb_funcall(err, rb_intern("backtrace"), 0);
1073 if (nxt_slow_path(RARRAY_LEN(ary) == 0)) {
1076
1077 if (RARRAY_LEN(ary) == 0) {
1078 nxt_unit_req_log(req, level, "Ruby: %s (%s)", RSTRING_PTR(msg),
1079 RSTRING_PTR(eclass));
1080
1074 return;
1075 }
1076
1081 return;
1082 }
1083
1077 eclass = rb_class_name(rb_class_of(err));
1078 msg = rb_funcall(err, rb_intern("message"), 0);
1079
1080 nxt_unit_req_log(req, level, "Ruby: %s: %s (%s)",
1081 RSTRING_PTR(RARRAY_PTR(ary)[0]),
1082 RSTRING_PTR(msg), RSTRING_PTR(eclass));
1083
1084 for (i = 1; i < RARRAY_LEN(ary); i++) {
1085 nxt_unit_req_log(req, level, "from %s",
1086 RSTRING_PTR(RARRAY_PTR(ary)[i]));
1087 }

--- 205 unchanged lines hidden ---
1084 nxt_unit_req_log(req, level, "Ruby: %s: %s (%s)",
1085 RSTRING_PTR(RARRAY_PTR(ary)[0]),
1086 RSTRING_PTR(msg), RSTRING_PTR(eclass));
1087
1088 for (i = 1; i < RARRAY_LEN(ary); i++) {
1089 nxt_unit_req_log(req, level, "from %s",
1090 RSTRING_PTR(RARRAY_PTR(ary)[i]));
1091 }

--- 205 unchanged lines hidden ---