Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::OpenSSLError#detailed_message
(?highlight: bool?, **untyped ignored) -> ::String
ossl_error.detailed_message(**) → string
ext/openssl/ossl.c
View on GitHub ↗
static VALUE
osslerror_detailed_message(int argc, VALUE *argv, VALUE self)
{
VALUE str;
#ifdef HAVE_RB_CALL_SUPER_KW
// Ruby >= 3.2
if (RTEST(rb_funcall(rb_eException, rb_intern("method_defined?"), 1,
ID2SYM(rb_intern("detailed_message")))))
str = rb_call_super_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
else
#endif
str = rb_funcall(self, rb_intern("message"), 0);
VALUE errors = rb_attr_get(self, id_i_errors);
// OpenSSLError was not created by ossl_make_error()
if (!RB_TYPE_P(errors, T_ARRAY))
return str;
str = rb_str_resurrect(str);
rb_str_catf(str, "\nOpenSSL error queue reported %"PRIdLEN" errors:",
RARRAY_LEN(errors));
for (rb_len_t i = 0; i < RARRAY_LEN(errors); i++) {
VALUE err = RARRAY_AREF(errors, i);
rb_str_catf(str, "\n%"PRIsVALUE, err);
}
return str;
}
Returns the exception message decorated with the captured OpenSSL error queue entries.
also in
4.0