frontend: also print whois client output on error
This commit is contained in:
parent
f999d47d9f
commit
09405cdb38
@ -25,13 +25,14 @@ func whois(s string) string {
|
|||||||
|
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
cmd := exec.Command(args[0], args[1:]...)
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
|
||||||
return err.Error()
|
|
||||||
}
|
|
||||||
if len(output) > 65535 {
|
if len(output) > 65535 {
|
||||||
output = output[:65535]
|
output = output[:65535]
|
||||||
}
|
}
|
||||||
return string(output)
|
if err != nil {
|
||||||
|
return err.Error() + "\n" + string(output)
|
||||||
|
} else {
|
||||||
|
return string(output)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
buf := make([]byte, 65536)
|
buf := make([]byte, 65536)
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ func whois(s string) string {
|
|||||||
|
|
||||||
n, err := io.ReadFull(conn, buf)
|
n, err := io.ReadFull(conn, buf)
|
||||||
if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
|
if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
|
||||||
return err.Error()
|
return err.Error() + "\n" + string(buf[:n])
|
||||||
}
|
}
|
||||||
return string(buf[:n])
|
return string(buf[:n])
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user