int val;Unfortunately this is still prompting the user with a window to commit when I try this and does not log an error.int val;if (!int.TryParse(Console.ReadLine(), out val)){Console.Error.WriteLine("Please enter a number");return;}
Yes it's compiled as a console app since I'm getting my read line. This is also not canceling the commit either, :)
I added it as as a hook script in the Hook Scripts settings. It's a start_commit_hook, and yes it's called as I get console window to enter to the console.When I enter a letter and read it with Console.ReadLine() the function should exit out and popup a error message, but it's not showing the error and it continues with the commit.