Skip to content

Commit

Permalink
[DOC] Add Socket::ResolutionError documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 17, 2023
1 parent 71c4a9c commit 0601bce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/socket/init.c
Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down

0 comments on commit 0601bce

Please sign in to comment.