grpc 1.28.0-universal-darwin → 1.31.0.pre1-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/src/ruby/ext/grpc/extconf.rb +5 -2
  3. data/src/ruby/ext/grpc/rb_call.c +12 -3
  4. data/src/ruby/ext/grpc/rb_call.h +4 -0
  5. data/src/ruby/ext/grpc/rb_call_credentials.c +57 -12
  6. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
  7. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
  8. data/src/ruby/lib/grpc/2.3/grpc_c.bundle +0 -0
  9. data/src/ruby/lib/grpc/2.4/grpc_c.bundle +0 -0
  10. data/src/ruby/lib/grpc/2.5/grpc_c.bundle +0 -0
  11. data/src/ruby/lib/grpc/2.6/grpc_c.bundle +0 -0
  12. data/src/ruby/lib/grpc/2.7/grpc_c.bundle +0 -0
  13. data/src/ruby/lib/grpc/errors.rb +103 -42
  14. data/src/ruby/lib/grpc/generic/active_call.rb +2 -3
  15. data/src/ruby/lib/grpc/generic/interceptors.rb +5 -5
  16. data/src/ruby/lib/grpc/generic/rpc_server.rb +9 -10
  17. data/src/ruby/lib/grpc/generic/service.rb +5 -4
  18. data/src/ruby/lib/grpc/structs.rb +1 -1
  19. data/src/ruby/lib/grpc/version.rb +1 -1
  20. data/src/ruby/pb/generate_proto_ruby.sh +5 -3
  21. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +11 -0
  22. data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +16 -0
  23. data/src/ruby/pb/test/xds_client.rb +213 -0
  24. data/src/ruby/spec/debug_message_spec.rb +134 -0
  25. data/src/ruby/spec/generic/service_spec.rb +2 -0
  26. data/src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto +23 -0
  27. data/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto +7 -0
  28. data/src/ruby/spec/pb/codegen/package_option_spec.rb +7 -1
  29. data/src/ruby/spec/support/services.rb +10 -4
  30. data/src/ruby/spec/testdata/ca.pem +18 -13
  31. data/src/ruby/spec/testdata/client.key +26 -14
  32. data/src/ruby/spec/testdata/client.pem +18 -12
  33. data/src/ruby/spec/testdata/server1.key +26 -14
  34. data/src/ruby/spec/testdata/server1.pem +20 -14
  35. metadata +45 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42059678fa98f7a931e5b36de30f8efd0dea41bb347533c367bb26aa1f8f1690
4
- data.tar.gz: bdfd6204d9b7f86554ad99c44da8a045601ebcf3c47c0126f06ca385a0642aee
3
+ metadata.gz: 36455f24129f51a8780cfb8927f46f563dd433aecbfd0c242a472f8910292e7d
4
+ data.tar.gz: a26d79183b2528fc7ac935aee479ceab083952fd0892326543cca7dc9e2b9218
5
5
  SHA512:
6
- metadata.gz: 2f83f49b67868e6570469579cb80bd838b664edae031835942b21a049df8eeea846062052aaeab85f61eab23c11b9576662bb9d317ae122d6f88962a9bef2c89
7
- data.tar.gz: eb050421d36c69cb1da5e30cd0f1a8308ae578c969a6324c3189a3fbde7490630dd05774ea3d61f1a406165246586e08aa76f56885c2e3814fb49ce8a9b51614
6
+ metadata.gz: 9f8865fe0581bdf1fbb6dde611f1a0bc0096d604ad0ce011e3894e33d9a32ab4cff53cb4e77f90052e27c53dd9d5429cfcad276aae399f89150e2067abcf063d
7
+ data.tar.gz: ef665ee9dc0852edb649811613c7dd04e504f099f377be3c94929be0e291fc4b031f2ef40c77acfa02576180be78d4f330bf0930852e916b168892dc2e44a0b0
@@ -25,7 +25,7 @@ grpc_config = ENV['GRPC_CONFIG'] || 'opt'
25
25
  ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
26
26
 
27
27
  if ENV['AR'].nil? || ENV['AR'].size == 0
28
- ENV['AR'] = RbConfig::CONFIG['AR'] + ' rcs'
28
+ ENV['AR'] = RbConfig::CONFIG['AR']
29
29
  end
30
30
  if ENV['CC'].nil? || ENV['CC'].size == 0
31
31
  ENV['CC'] = RbConfig::CONFIG['CC']
@@ -37,7 +37,10 @@ if ENV['LD'].nil? || ENV['LD'].size == 0
37
37
  ENV['LD'] = ENV['CC']
38
38
  end
39
39
 
40
- ENV['AR'] = 'libtool -o' if RUBY_PLATFORM =~ /darwin/
40
+ if RUBY_PLATFORM =~ /darwin/
41
+ ENV['AR'] = 'libtool'
42
+ ENV['ARFLAGS'] = '-o'
43
+ end
41
44
 
42
45
  ENV['EMBED_OPENSSL'] = 'true'
43
46
  ENV['EMBED_ZLIB'] = 'true'
@@ -48,7 +48,7 @@ static VALUE grpc_rb_sBatchResult;
48
48
 
49
49
  /* grpc_rb_cMdAry is the MetadataArray class whose instances proxy
50
50
  * grpc_metadata_array. */
51
- static VALUE grpc_rb_cMdAry;
51
+ VALUE grpc_rb_cMdAry;
52
52
 
53
53
  /* id_credentials is the name of the hidden ivar that preserves the value
54
54
  * of the credentials added to the call */
@@ -103,7 +103,7 @@ static void grpc_rb_call_destroy(void* p) {
103
103
  xfree(p);
104
104
  }
105
105
 
106
- static const rb_data_type_t grpc_rb_md_ary_data_type = {
106
+ const rb_data_type_t grpc_rb_md_ary_data_type = {
107
107
  "grpc_metadata_array",
108
108
  {GRPC_RB_GC_NOT_MARKED,
109
109
  GRPC_RB_GC_DONT_FREE,
@@ -489,6 +489,7 @@ static int grpc_rb_md_ary_capacity_hash_cb(VALUE key, VALUE val,
489
489
 
490
490
  /* grpc_rb_md_ary_convert converts a ruby metadata hash into
491
491
  a grpc_metadata_array.
492
+ Note that this function may throw exceptions.
492
493
  */
493
494
  void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array* md_ary) {
494
495
  VALUE md_ary_obj = Qnil;
@@ -620,6 +621,7 @@ typedef struct run_batch_stack {
620
621
  int recv_cancelled;
621
622
  grpc_status_code recv_status;
622
623
  grpc_slice recv_status_details;
624
+ const char* recv_status_debug_error_string;
623
625
  unsigned write_flag;
624
626
  grpc_slice send_status_details;
625
627
  } run_batch_stack;
@@ -729,6 +731,8 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack* st, VALUE ops_hash) {
729
731
  &st->recv_status;
730
732
  st->ops[st->op_num].data.recv_status_on_client.status_details =
731
733
  &st->recv_status_details;
734
+ st->ops[st->op_num].data.recv_status_on_client.error_string =
735
+ &st->recv_status_debug_error_string;
732
736
  break;
733
737
  case GRPC_OP_RECV_CLOSE_ON_SERVER:
734
738
  st->ops[st->op_num].data.recv_close_on_server.cancelled =
@@ -780,7 +784,12 @@ static VALUE grpc_run_batch_stack_build_result(run_batch_stack* st) {
780
784
  (GRPC_SLICE_START_PTR(st->recv_status_details) == NULL
781
785
  ? Qnil
782
786
  : grpc_rb_slice_to_ruby_string(st->recv_status_details)),
783
- grpc_rb_md_ary_to_h(&st->recv_trailing_metadata), NULL));
787
+ grpc_rb_md_ary_to_h(&st->recv_trailing_metadata),
788
+ st->recv_status_debug_error_string == NULL
789
+ ? Qnil
790
+ : rb_str_new_cstr(st->recv_status_debug_error_string),
791
+ NULL));
792
+ gpr_free((void*)st->recv_status_debug_error_string);
784
793
  break;
785
794
  case GRPC_OP_RECV_CLOSE_ON_SERVER:
786
795
  rb_struct_aset(result, sym_send_close, Qtrue);
@@ -23,6 +23,10 @@
23
23
 
24
24
  #include <grpc/grpc.h>
25
25
 
26
+ extern const rb_data_type_t grpc_rb_md_ary_data_type;
27
+
28
+ extern VALUE grpc_rb_cMdAry;
29
+
26
30
  /* Gets the wrapped call from a VALUE. */
27
31
  grpc_call* grpc_rb_get_wrapped_call(VALUE v);
28
32
 
@@ -54,10 +54,41 @@ typedef struct callback_params {
54
54
  grpc_credentials_plugin_metadata_cb callback;
55
55
  } callback_params;
56
56
 
57
- static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) {
57
+ static VALUE grpc_rb_call_credentials_callback(VALUE args) {
58
58
  VALUE result = rb_hash_new();
59
- VALUE metadata = rb_funcall(rb_ary_entry(callback_args, 0), rb_intern("call"),
60
- 1, rb_ary_entry(callback_args, 1));
59
+ VALUE callback_func = rb_ary_entry(args, 0);
60
+ VALUE callback_args = rb_ary_entry(args, 1);
61
+ VALUE md_ary_obj = rb_ary_entry(args, 2);
62
+ if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
63
+ VALUE callback_func_str = rb_funcall(callback_func, rb_intern("to_s"), 0);
64
+ VALUE callback_args_str = rb_funcall(callback_args, rb_intern("to_s"), 0);
65
+ VALUE callback_source_info =
66
+ rb_funcall(callback_func, rb_intern("source_location"), 0);
67
+ if (callback_source_info != Qnil) {
68
+ VALUE source_filename = rb_ary_entry(callback_source_info, 0);
69
+ VALUE source_line_number = rb_funcall(
70
+ rb_ary_entry(callback_source_info, 1), rb_intern("to_s"), 0);
71
+ gpr_log(GPR_DEBUG,
72
+ "GRPC_RUBY: grpc_rb_call_credentials invoking user callback:|%s| "
73
+ "source_filename:%s line_number:%s with arguments:|%s|",
74
+ StringValueCStr(callback_func_str),
75
+ StringValueCStr(source_filename),
76
+ StringValueCStr(source_line_number),
77
+ StringValueCStr(callback_args_str));
78
+ } else {
79
+ gpr_log(GPR_DEBUG,
80
+ "GRPC_RUBY: grpc_rb_call_credentials invoking user callback:|%s| "
81
+ "(failed to get source filename and line) with arguments:|%s|",
82
+ StringValueCStr(callback_func_str),
83
+ StringValueCStr(callback_args_str));
84
+ }
85
+ }
86
+ VALUE metadata =
87
+ rb_funcall(callback_func, rb_intern("call"), 1, callback_args);
88
+ grpc_metadata_array* md_ary = NULL;
89
+ TypedData_Get_Struct(md_ary_obj, grpc_metadata_array,
90
+ &grpc_rb_md_ary_data_type, md_ary);
91
+ grpc_rb_md_ary_convert(metadata, md_ary);
61
92
  rb_hash_aset(result, rb_str_new2("metadata"), metadata);
62
93
  rb_hash_aset(result, rb_str_new2("status"), INT2NUM(GRPC_STATUS_OK));
63
94
  rb_hash_aset(result, rb_str_new2("details"), rb_str_new2(""));
@@ -67,14 +98,23 @@ static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) {
67
98
  static VALUE grpc_rb_call_credentials_callback_rescue(VALUE args,
68
99
  VALUE exception_object) {
69
100
  VALUE result = rb_hash_new();
70
- VALUE backtrace =
71
- rb_funcall(rb_funcall(exception_object, rb_intern("backtrace"), 0),
72
- rb_intern("join"), 1, rb_str_new2("\n\tfrom "));
101
+ VALUE backtrace = rb_funcall(exception_object, rb_intern("backtrace"), 0);
102
+ VALUE backtrace_str;
103
+ if (backtrace != Qnil) {
104
+ backtrace_str =
105
+ rb_funcall(backtrace, rb_intern("join"), 1, rb_str_new2("\n\tfrom "));
106
+ } else {
107
+ backtrace_str = rb_str_new2(
108
+ "failed to get backtrace, this exception was likely thrown from native "
109
+ "code");
110
+ }
73
111
  VALUE rb_exception_info =
74
112
  rb_funcall(exception_object, rb_intern("inspect"), 0);
75
113
  (void)args;
76
- gpr_log(GPR_INFO, "Call credentials callback failed: %s\n%s",
77
- StringValueCStr(rb_exception_info), StringValueCStr(backtrace));
114
+ gpr_log(GPR_INFO,
115
+ "GRPC_RUBY call credentials callback failed, exception inspect:|%s| "
116
+ "backtrace:|%s|",
117
+ StringValueCStr(rb_exception_info), StringValueCStr(backtrace_str));
78
118
  rb_hash_aset(result, rb_str_new2("metadata"), Qnil);
79
119
  rb_hash_aset(result, rb_str_new2("status"),
80
120
  INT2NUM(GRPC_STATUS_UNAUTHENTICATED));
@@ -98,17 +138,22 @@ static void grpc_rb_call_credentials_callback_with_gil(void* param) {
98
138
  rb_hash_aset(args, ID2SYM(rb_intern("jwt_aud_uri")), auth_uri);
99
139
  rb_ary_push(callback_args, params->get_metadata);
100
140
  rb_ary_push(callback_args, args);
141
+ // Wrap up the grpc_metadata_array into a ruby object and do the conversion
142
+ // from hash to grpc_metadata_array within the rescue block, because the
143
+ // conversion can throw exceptions.
144
+ rb_ary_push(callback_args,
145
+ TypedData_Wrap_Struct(grpc_rb_cMdAry, &grpc_rb_md_ary_data_type,
146
+ &md_ary));
101
147
  result = rb_rescue(grpc_rb_call_credentials_callback, callback_args,
102
148
  grpc_rb_call_credentials_callback_rescue, Qnil);
103
149
  // Both callbacks return a hash, so result should be a hash
104
- grpc_rb_md_ary_convert(rb_hash_aref(result, rb_str_new2("metadata")),
105
- &md_ary);
106
150
  status = NUM2INT(rb_hash_aref(result, rb_str_new2("status")));
107
151
  details = rb_hash_aref(result, rb_str_new2("details"));
108
152
  error_details = StringValueCStr(details);
109
153
  params->callback(params->user_data, md_ary.metadata, md_ary.count, status,
110
154
  error_details);
111
155
  grpc_rb_metadata_array_destroy_including_entries(&md_ary);
156
+ grpc_auth_metadata_context_reset(&params->context);
112
157
  gpr_free(params);
113
158
  }
114
159
 
@@ -118,9 +163,9 @@ static int grpc_rb_call_credentials_plugin_get_metadata(
118
163
  grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
119
164
  size_t* num_creds_md, grpc_status_code* status,
120
165
  const char** error_details) {
121
- callback_params* params = gpr_malloc(sizeof(callback_params));
166
+ callback_params* params = gpr_zalloc(sizeof(callback_params));
122
167
  params->get_metadata = (VALUE)state;
123
- params->context = context;
168
+ grpc_auth_metadata_context_copy(&context, &params->context);
124
169
  params->user_data = user_data;
125
170
  params->callback = cb;
126
171
 
@@ -135,6 +135,8 @@ grpc_google_refresh_token_credentials_create_type grpc_google_refresh_token_cred
135
135
  grpc_access_token_credentials_create_type grpc_access_token_credentials_create_import;
136
136
  grpc_google_iam_credentials_create_type grpc_google_iam_credentials_create_import;
137
137
  grpc_sts_credentials_create_type grpc_sts_credentials_create_import;
138
+ grpc_auth_metadata_context_copy_type grpc_auth_metadata_context_copy_import;
139
+ grpc_auth_metadata_context_reset_type grpc_auth_metadata_context_reset_import;
138
140
  grpc_metadata_credentials_create_from_plugin_type grpc_metadata_credentials_create_from_plugin_import;
139
141
  grpc_secure_channel_create_type grpc_secure_channel_create_import;
140
142
  grpc_server_credentials_release_type grpc_server_credentials_release_import;
@@ -407,6 +409,8 @@ void grpc_rb_load_imports(HMODULE library) {
407
409
  grpc_access_token_credentials_create_import = (grpc_access_token_credentials_create_type) GetProcAddress(library, "grpc_access_token_credentials_create");
408
410
  grpc_google_iam_credentials_create_import = (grpc_google_iam_credentials_create_type) GetProcAddress(library, "grpc_google_iam_credentials_create");
409
411
  grpc_sts_credentials_create_import = (grpc_sts_credentials_create_type) GetProcAddress(library, "grpc_sts_credentials_create");
412
+ grpc_auth_metadata_context_copy_import = (grpc_auth_metadata_context_copy_type) GetProcAddress(library, "grpc_auth_metadata_context_copy");
413
+ grpc_auth_metadata_context_reset_import = (grpc_auth_metadata_context_reset_type) GetProcAddress(library, "grpc_auth_metadata_context_reset");
410
414
  grpc_metadata_credentials_create_from_plugin_import = (grpc_metadata_credentials_create_from_plugin_type) GetProcAddress(library, "grpc_metadata_credentials_create_from_plugin");
411
415
  grpc_secure_channel_create_import = (grpc_secure_channel_create_type) GetProcAddress(library, "grpc_secure_channel_create");
412
416
  grpc_server_credentials_release_import = (grpc_server_credentials_release_type) GetProcAddress(library, "grpc_server_credentials_release");
@@ -380,6 +380,12 @@ extern grpc_google_iam_credentials_create_type grpc_google_iam_credentials_creat
380
380
  typedef grpc_call_credentials*(*grpc_sts_credentials_create_type)(const grpc_sts_credentials_options* options, void* reserved);
381
381
  extern grpc_sts_credentials_create_type grpc_sts_credentials_create_import;
382
382
  #define grpc_sts_credentials_create grpc_sts_credentials_create_import
383
+ typedef void(*grpc_auth_metadata_context_copy_type)(grpc_auth_metadata_context* from, grpc_auth_metadata_context* to);
384
+ extern grpc_auth_metadata_context_copy_type grpc_auth_metadata_context_copy_import;
385
+ #define grpc_auth_metadata_context_copy grpc_auth_metadata_context_copy_import
386
+ typedef void(*grpc_auth_metadata_context_reset_type)(grpc_auth_metadata_context* context);
387
+ extern grpc_auth_metadata_context_reset_type grpc_auth_metadata_context_reset_import;
388
+ #define grpc_auth_metadata_context_reset grpc_auth_metadata_context_reset_import
383
389
  typedef grpc_call_credentials*(*grpc_metadata_credentials_create_from_plugin_type)(grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void* reserved);
384
390
  extern grpc_metadata_credentials_create_from_plugin_type grpc_metadata_credentials_create_from_plugin_import;
385
391
  #define grpc_metadata_credentials_create_from_plugin grpc_metadata_credentials_create_from_plugin_import
@@ -30,18 +30,26 @@ module GRPC
30
30
  # https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/status.h
31
31
  # for detailed descriptions of each status code.
32
32
  class BadStatus < StandardError
33
- attr_reader :code, :details, :metadata
33
+ attr_reader :code, :details, :metadata, :debug_error_string
34
34
 
35
35
  include GRPC::Core::StatusCodes
36
36
 
37
37
  # @param code [Numeric] the status code
38
38
  # @param details [String] the details of the exception
39
39
  # @param metadata [Hash] the error's metadata
40
- def initialize(code, details = 'unknown cause', metadata = {})
41
- super("#{code}:#{details}")
40
+ def initialize(code,
41
+ details = 'unknown cause',
42
+ metadata = {},
43
+ debug_error_string = nil)
44
+ exception_message = "#{code}:#{details}"
45
+ if debug_error_string
46
+ exception_message += ". debug_error_string:#{debug_error_string}"
47
+ end
48
+ super(exception_message)
42
49
  @code = code
43
50
  @details = details
44
51
  @metadata = metadata
52
+ @debug_error_string = debug_error_string
45
53
  end
46
54
 
47
55
  # Converts the exception to a {Struct::Status} for use in the networking
@@ -49,7 +57,7 @@ module GRPC
49
57
  #
50
58
  # @return [Struct::Status] with the same code and details
51
59
  def to_status
52
- Struct::Status.new(code, details, metadata)
60
+ Struct::Status.new(code, details, metadata, debug_error_string)
53
61
  end
54
62
 
55
63
  # Converts the exception to a deserialized {Google::Rpc::Status} object.
@@ -66,8 +74,10 @@ module GRPC
66
74
  nil
67
75
  end
68
76
 
69
- def self.new_status_exception(code, details = 'unknown cause',
70
- metadata = {})
77
+ def self.new_status_exception(code,
78
+ details = 'unknown cause',
79
+ metadata = {},
80
+ debug_error_string = nil)
71
81
  codes = {}
72
82
  codes[OK] = Ok
73
83
  codes[CANCELLED] = Cancelled
@@ -88,129 +98,180 @@ module GRPC
88
98
  codes[DATA_LOSS] = DataLoss
89
99
 
90
100
  if codes[code].nil?
91
- BadStatus.new(code, details, metadata)
101
+ BadStatus.new(code, details, metadata, debug_error_string)
92
102
  else
93
- codes[code].new(details, metadata)
103
+ codes[code].new(details, metadata, debug_error_string)
94
104
  end
95
105
  end
96
106
  end
97
107
 
98
108
  # GRPC status code corresponding to status OK
99
109
  class Ok < BadStatus
100
- def initialize(details = 'unknown cause', metadata = {})
101
- super(Core::StatusCodes::OK, details, metadata)
110
+ def initialize(details = 'unknown cause',
111
+ metadata = {},
112
+ debug_error_string = nil)
113
+ super(Core::StatusCodes::OK,
114
+ details, metadata, debug_error_string)
102
115
  end
103
116
  end
104
117
 
105
118
  # GRPC status code corresponding to status CANCELLED
106
119
  class Cancelled < BadStatus
107
- def initialize(details = 'unknown cause', metadata = {})
108
- super(Core::StatusCodes::CANCELLED, details, metadata)
120
+ def initialize(details = 'unknown cause',
121
+ metadata = {},
122
+ debug_error_string = nil)
123
+ super(Core::StatusCodes::CANCELLED,
124
+ details, metadata, debug_error_string)
109
125
  end
110
126
  end
111
127
 
112
128
  # GRPC status code corresponding to status UNKNOWN
113
129
  class Unknown < BadStatus
114
- def initialize(details = 'unknown cause', metadata = {})
115
- super(Core::StatusCodes::UNKNOWN, details, metadata)
130
+ def initialize(details = 'unknown cause',
131
+ metadata = {},
132
+ debug_error_string = nil)
133
+ super(Core::StatusCodes::UNKNOWN,
134
+ details, metadata, debug_error_string)
116
135
  end
117
136
  end
118
137
 
119
138
  # GRPC status code corresponding to status INVALID_ARGUMENT
120
139
  class InvalidArgument < BadStatus
121
- def initialize(details = 'unknown cause', metadata = {})
122
- super(Core::StatusCodes::INVALID_ARGUMENT, details, metadata)
140
+ def initialize(details = 'unknown cause',
141
+ metadata = {},
142
+ debug_error_string = nil)
143
+ super(Core::StatusCodes::INVALID_ARGUMENT,
144
+ details, metadata, debug_error_string)
123
145
  end
124
146
  end
125
147
 
126
148
  # GRPC status code corresponding to status DEADLINE_EXCEEDED
127
149
  class DeadlineExceeded < BadStatus
128
- def initialize(details = 'unknown cause', metadata = {})
129
- super(Core::StatusCodes::DEADLINE_EXCEEDED, details, metadata)
150
+ def initialize(details = 'unknown cause',
151
+ metadata = {},
152
+ debug_error_string = nil)
153
+ super(Core::StatusCodes::DEADLINE_EXCEEDED,
154
+ details, metadata, debug_error_string)
130
155
  end
131
156
  end
132
157
 
133
158
  # GRPC status code corresponding to status NOT_FOUND
134
159
  class NotFound < BadStatus
135
- def initialize(details = 'unknown cause', metadata = {})
136
- super(Core::StatusCodes::NOT_FOUND, details, metadata)
160
+ def initialize(details = 'unknown cause',
161
+ metadata = {},
162
+ debug_error_string = nil)
163
+ super(Core::StatusCodes::NOT_FOUND,
164
+ details, metadata, debug_error_string)
137
165
  end
138
166
  end
139
167
 
140
168
  # GRPC status code corresponding to status ALREADY_EXISTS
141
169
  class AlreadyExists < BadStatus
142
- def initialize(details = 'unknown cause', metadata = {})
143
- super(Core::StatusCodes::ALREADY_EXISTS, details, metadata)
170
+ def initialize(details = 'unknown cause',
171
+ metadata = {},
172
+ debug_error_string = nil)
173
+ super(Core::StatusCodes::ALREADY_EXISTS,
174
+ details, metadata, debug_error_string)
144
175
  end
145
176
  end
146
177
 
147
178
  # GRPC status code corresponding to status PERMISSION_DENIED
148
179
  class PermissionDenied < BadStatus
149
- def initialize(details = 'unknown cause', metadata = {})
150
- super(Core::StatusCodes::PERMISSION_DENIED, details, metadata)
180
+ def initialize(details = 'unknown cause',
181
+ metadata = {},
182
+ debug_error_string = nil)
183
+ super(Core::StatusCodes::PERMISSION_DENIED,
184
+ details, metadata, debug_error_string)
151
185
  end
152
186
  end
153
187
 
154
188
  # GRPC status code corresponding to status UNAUTHENTICATED
155
189
  class Unauthenticated < BadStatus
156
- def initialize(details = 'unknown cause', metadata = {})
157
- super(Core::StatusCodes::UNAUTHENTICATED, details, metadata)
190
+ def initialize(details = 'unknown cause',
191
+ metadata = {},
192
+ debug_error_string = nil)
193
+ super(Core::StatusCodes::UNAUTHENTICATED,
194
+ details, metadata, debug_error_string)
158
195
  end
159
196
  end
160
197
 
161
198
  # GRPC status code corresponding to status RESOURCE_EXHAUSTED
162
199
  class ResourceExhausted < BadStatus
163
- def initialize(details = 'unknown cause', metadata = {})
164
- super(Core::StatusCodes::RESOURCE_EXHAUSTED, details, metadata)
200
+ def initialize(details = 'unknown cause',
201
+ metadata = {},
202
+ debug_error_string = nil)
203
+ super(Core::StatusCodes::RESOURCE_EXHAUSTED,
204
+ details, metadata, debug_error_string)
165
205
  end
166
206
  end
167
207
 
168
208
  # GRPC status code corresponding to status FAILED_PRECONDITION
169
209
  class FailedPrecondition < BadStatus
170
- def initialize(details = 'unknown cause', metadata = {})
171
- super(Core::StatusCodes::FAILED_PRECONDITION, details, metadata)
210
+ def initialize(details = 'unknown cause',
211
+ metadata = {},
212
+ debug_error_string = nil)
213
+ super(Core::StatusCodes::FAILED_PRECONDITION,
214
+ details, metadata, debug_error_string)
172
215
  end
173
216
  end
174
217
 
175
218
  # GRPC status code corresponding to status ABORTED
176
219
  class Aborted < BadStatus
177
- def initialize(details = 'unknown cause', metadata = {})
178
- super(Core::StatusCodes::ABORTED, details, metadata)
220
+ def initialize(details = 'unknown cause',
221
+ metadata = {},
222
+ debug_error_string = nil)
223
+ super(Core::StatusCodes::ABORTED,
224
+ details, metadata, debug_error_string)
179
225
  end
180
226
  end
181
227
 
182
228
  # GRPC status code corresponding to status OUT_OF_RANGE
183
229
  class OutOfRange < BadStatus
184
- def initialize(details = 'unknown cause', metadata = {})
185
- super(Core::StatusCodes::OUT_OF_RANGE, details, metadata)
230
+ def initialize(details = 'unknown cause',
231
+ metadata = {},
232
+ debug_error_string = nil)
233
+ super(Core::StatusCodes::OUT_OF_RANGE,
234
+ details, metadata, debug_error_string)
186
235
  end
187
236
  end
188
237
 
189
238
  # GRPC status code corresponding to status UNIMPLEMENTED
190
239
  class Unimplemented < BadStatus
191
- def initialize(details = 'unknown cause', metadata = {})
192
- super(Core::StatusCodes::UNIMPLEMENTED, details, metadata)
240
+ def initialize(details = 'unknown cause',
241
+ metadata = {},
242
+ debug_error_string = nil)
243
+ super(Core::StatusCodes::UNIMPLEMENTED,
244
+ details, metadata, debug_error_string)
193
245
  end
194
246
  end
195
247
 
196
248
  # GRPC status code corresponding to status INTERNAL
197
249
  class Internal < BadStatus
198
- def initialize(details = 'unknown cause', metadata = {})
199
- super(Core::StatusCodes::INTERNAL, details, metadata)
250
+ def initialize(details = 'unknown cause',
251
+ metadata = {},
252
+ debug_error_string = nil)
253
+ super(Core::StatusCodes::INTERNAL,
254
+ details, metadata, debug_error_string)
200
255
  end
201
256
  end
202
257
 
203
258
  # GRPC status code corresponding to status UNAVAILABLE
204
259
  class Unavailable < BadStatus
205
- def initialize(details = 'unknown cause', metadata = {})
206
- super(Core::StatusCodes::UNAVAILABLE, details, metadata)
260
+ def initialize(details = 'unknown cause',
261
+ metadata = {},
262
+ debug_error_string = nil)
263
+ super(Core::StatusCodes::UNAVAILABLE,
264
+ details, metadata, debug_error_string)
207
265
  end
208
266
  end
209
267
 
210
268
  # GRPC status code corresponding to status DATA_LOSS
211
269
  class DataLoss < BadStatus
212
- def initialize(details = 'unknown cause', metadata = {})
213
- super(Core::StatusCodes::DATA_LOSS, details, metadata)
270
+ def initialize(details = 'unknown cause',
271
+ metadata = {},
272
+ debug_error_string = nil)
273
+ super(Core::StatusCodes::DATA_LOSS,
274
+ details, metadata, debug_error_string)
214
275
  end
215
276
  end
216
277
  end