Skip to content

Commit b1a2a9a

Browse files
Returns actual error
1 parent c8fac63 commit b1a2a9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/openwebnet-discovery.nse

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,18 @@ local function get_socket(host, port, request)
108108
local sd, response, early_resp = comm.opencon(host, port, request, {recv_before=true})
109109

110110
if sd == nil then
111-
return nil, "Socket connection error."
111+
stdnse.debug("Socket connection error.")
112+
return nil, response
112113
end
113114

114115
if not response then
115-
return nil, "Poor internet connection or no response."
116+
stdnse.debug("Poor internet connection or no response.")
117+
return nil, response
116118
end
117119

118120
if response == NACK then
119-
return nil, "Received a negative ACK as response."
121+
stdnse.debug("Received a negative ACK as response.")
122+
return nil, response
120123
end
121124

122125
return sd, nil

0 commit comments

Comments
 (0)