Permalink
Browse files

Pass errstr and errno through

  • Loading branch information...
apfelbox committed Sep 3, 2012
1 parent 4ab26e2 commit 33c3ed80616a524f90f4f8181298e6bbb31404b8
Showing with 1 addition and 1 deletion.
  1. +1 −1 PHPGangsta/WakeOnLAN.php
View
@@ -18,7 +18,7 @@ public static function wakeUp($macAddressHexadecimal, $broadcastAddress)
$magicPacket = str_repeat(chr(0xff), 6).str_repeat($macAddressBinary, 16);
if (!$fp = fsockopen('udp://' . $broadcastAddress, 7, $errno, $errstr, 2)) {
- throw new \Exception('Cannot open UDP socket');
+ throw new \Exception("Cannot open UDP socket: {$errstr}", $errno);
}
fputs($fp, $magicPacket);
fclose($fp);

0 comments on commit 33c3ed8

Please sign in to comment.