How to reproduce:
- Turn off networking on your computer.
- Eval this code in the repl:
(handler-case (usocket:get-hosts-by-name "github.com")
(USOCKET:NS-HOST-NOT-FOUND-ERROR (c)
(format nil "Slot bound: ~A"
(slot-boundp c 'usocket::host-or-ip))))
It will output:
If you eval (usocket:get-hosts-by-name "github.com") then you'll see such traceback:
Condition USOCKET:NS-HOST-NOT-FOUND-ERROR was signalled.
[Condition of type USOCKET:NS-HOST-NOT-FOUND-ERROR]
Restarts:
0: [RETRY-REQUEST] Retry the same request.
1: [RETRY] Retry SLY mREPL evaluation request.
2: [*ABORT] Return to SLY's top level.
3: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1003C8BFF3}>)
Backtrace:
0: (USOCKET::HANDLE-CONDITION #<SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR {1006D91CE3}> NIL)
1: (SB-KERNEL::%SIGNAL #<SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR {1006D91CE3}>)
2: (ERROR SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR :ERROR-CODE 8 :SYSCALL "getaddrinfo")
3: (SB-BSD-SOCKETS::ADDRINFO-ERROR "getaddrinfo" 8)
4: (SB-BSD-SOCKETS:GET-HOST-BY-NAME #<unavailable argument>)
5: (USOCKET:GET-HOSTS-BY-NAME "api.github.com")
6: (USOCKET:SOCKET-CONNECT "api.github.com" 443 :PROTOCOL :STREAM :ELEMENT-TYPE (UNSIGNED-BYTE 8) :TIMEOUT 10 :DEADLINE NIL :NODELAY T :LOCAL-HOST NIL :LOCAL-PORT NIL)
Inspecting condition object shows:
#<USOCKET:NS-HOST-NOT-FOUND-ERROR {1006D91DA3}>
--------------------
The object is a CONDITION of type USOCKET:NS-HOST-NOT-FOUND-ERROR.
HOST-OR-IP: #<unbound>
How to reproduce:
It will output:
If you eval
(usocket:get-hosts-by-name "github.com")then you'll see such traceback:Inspecting condition object shows: