diff options
| author | Augustin Gottlieb <33221555+aguspe@users.noreply.github.com> | 2026-01-02 17:54:42 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-01-04 06:56:57 +0000 |
| commit | 912cf819b96a7ada89db044add26e94746f3ebb5 (patch) | |
| tree | 26192aaff3ebee6424c8014c801acac78df9153f /ext | |
| parent | ca0fece56a3ddfa6b9ec9cf1652e414929040614 (diff) | |
[ruby/openssl] Improve Argument Error Message in EC:Group.new
Before, passing the wrong number of arguments (e.g., 2) to
OpenSSL::PKey::EC::Group.new raised a generic "wrong number of
arguments"
error.
This change updates it to show the actual argument count and the
expected
options (1 or 4), making debugging easier for the user.
Example:
ArgumentError: wrong number of arguments (given 2, expected 1 or 4)
I hope it helps!
https://github.com/ruby/openssl/commit/783c99e6c7
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/openssl/ossl_pkey_ec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c index bb19533edf..35f031819d 100644 --- a/ext/openssl/ossl_pkey_ec.c +++ b/ext/openssl/ossl_pkey_ec.c @@ -702,7 +702,7 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self) break; default: - ossl_raise(rb_eArgError, "wrong number of arguments"); + ossl_raise(rb_eArgError, "wrong number of arguments (given %d, expected 1 or 4)", argc); } ASSUME(group); |
