try catch and logging in hub
This commit is contained in:
parent
d21a0e176a
commit
769eabd9e4
@ -26,6 +26,8 @@ namespace BinaryDad.Notes
|
||||
}
|
||||
|
||||
public async Task SaveNote(string content, string noteName)
|
||||
{
|
||||
try
|
||||
{
|
||||
logger.LogInformation($"Saving note \"{noteName}\"");
|
||||
|
||||
@ -41,6 +43,13 @@ namespace BinaryDad.Notes
|
||||
await Clients
|
||||
.Clients(clientConnections)
|
||||
.SendAsync("updateNote", content);
|
||||
|
||||
logger.LogInformation($"NOTE \"{noteName}\" SAVED! Updated {clientConnections.Count} other client(s).");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError($"Unable to save note \"{noteName}\" => {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user