mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-08 14:48:47 -04:00
Attempt to catch UnauthorizedAccessException when reading from stdin to avoid constant error log spam when stdin is unreadable
This can happen e.g. if being run in nohup mode
This commit is contained in:
parent
5e89553ad4
commit
a3dd5b5166
@ -199,6 +199,12 @@ namespace MCGalaxy.Cli {
|
||||
} else {
|
||||
UIHelpers.HandleChat(msg);
|
||||
}
|
||||
} catch (UnauthorizedAccessException) {
|
||||
// UnauthorizedAccessException can get thrown when stdin is unreadable
|
||||
// See https://github.com/dotnet/runtime/issues/21913 for instance
|
||||
Write("&e** Access denied to stdin, console no longer accepts input **");
|
||||
Write("&e** If nohup is being used, remove that to avoid this issue **");
|
||||
break;
|
||||
} catch (Exception ex) {
|
||||
// ArgumentException is raised on Mono when you:
|
||||
// 1) Type a message into a large CLI window
|
||||
|
Loading…
x
Reference in New Issue
Block a user