mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-04 21:08:28 +00:00
update exception message
`fputs()` can return `int|false`. if it fails and `$sent` is `false`, then our exception message looks a little confusing: > Only of XXX bytes were sent This change updates the message to be more descriptive if the `fputs()` fails.
This commit is contained in:
parent
8b67d0ac32
commit
d4263e854d
@ -4266,7 +4266,8 @@ class SSH2
|
||||
|
||||
if (strlen($packet) != $sent) {
|
||||
$this->bitmap = 0;
|
||||
throw new \RuntimeException("Only $sent of " . strlen($packet) . " bytes were sent");
|
||||
$message = $sent === false ? ('Unable to write ' . strlen($packet) . ' bytes') : ("Only $sent of " . strlen($packet) . " bytes were sent");
|
||||
throw new \RuntimeException($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user