From 0601bce6fc57cef5ae22a944b15b8e9fca1ef6ef Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 18 Dec 2023 08:49:06 +0900 Subject: [PATCH] [DOC] Add Socket::ResolutionError documentation --- ext/socket/init.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/socket/init.c b/ext/socket/init.c index 15b639f400c578..dd1158e19d2252 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -778,6 +778,12 @@ rsock_getfamily(rb_io_t *fptr) return ss.addr.sa_family; } +/* + * call-seq: + * error_code -> integer + * + * Returns the raw error code occurred at name resolution. + */ static VALUE sock_resolv_error_code(VALUE self) { @@ -791,6 +797,9 @@ rsock_init_socket_init(void) * SocketError is the error class for socket. */ rb_eSocket = rb_define_class("SocketError", rb_eStandardError); + /* + * ResolutionError is the error class for socket name resolution. + */ rb_eResolution = rb_define_class_under(rb_cSocket, "ResolutionError", rb_eSocket); rb_define_method(rb_eResolution, "error_code", sock_resolv_error_code, 0); rsock_init_ipsocket();