[Modify] Polish it
This commit is contained in:
parent
59f93c7134
commit
92dc2cc54b
@ -3131,12 +3131,16 @@ namespace WebSocketSharp
|
|||||||
if (fileInfo == null)
|
if (fileInfo == null)
|
||||||
throw new ArgumentNullException ("fileInfo");
|
throw new ArgumentNullException ("fileInfo");
|
||||||
|
|
||||||
if (!fileInfo.Exists)
|
if (!fileInfo.Exists) {
|
||||||
throw new ArgumentException ("The file does not exist.", "fileInfo");
|
var msg = "The file does not exist.";
|
||||||
|
throw new ArgumentException (msg, "fileInfo");
|
||||||
|
}
|
||||||
|
|
||||||
FileStream stream;
|
FileStream stream;
|
||||||
if (!fileInfo.TryOpenRead (out stream))
|
if (!fileInfo.TryOpenRead (out stream)) {
|
||||||
throw new ArgumentException ("The file could not be opened.", "fileInfo");
|
var msg = "The file could not be opened.";
|
||||||
|
throw new ArgumentException (msg, "fileInfo");
|
||||||
|
}
|
||||||
|
|
||||||
send (Opcode.Binary, stream);
|
send (Opcode.Binary, stream);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user