mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Add addtional error handling to enbedded file server
This commit is contained in:
parent
75641b4f30
commit
41e6b46311
1 changed files with 9 additions and 1 deletions
|
@ -54,8 +54,16 @@ namespace Nibriboard.Client
|
||||||
|
|
||||||
byte[] embeddedFile = EmbeddedFiles.ReadAllBytes(expandedFilePath);
|
byte[] embeddedFile = EmbeddedFiles.ReadAllBytes(expandedFilePath);
|
||||||
response.ContentLength = embeddedFile.Length;
|
response.ContentLength = embeddedFile.Length;
|
||||||
response.Content.Write(embeddedFile, 0, embeddedFile.Length);
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.Content.Write(embeddedFile, 0, embeddedFile.Length);
|
||||||
|
}
|
||||||
|
catch(Exception error)
|
||||||
|
{
|
||||||
|
Log.WriteLine($"[Nibriboard/EmbeddedFileHandler] Error: {error.Message} Details:");
|
||||||
|
Log.WriteLine(error.ToString());
|
||||||
|
}
|
||||||
logRequest(request, response);
|
logRequest(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue