[Modify] Polish it
This commit is contained in:
parent
998702e56d
commit
76e74741e0
@ -3342,12 +3342,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");
|
||||||
|
}
|
||||||
|
|
||||||
sendAsync (Opcode.Binary, stream, completed);
|
sendAsync (Opcode.Binary, stream, completed);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user