hactoolnet: Write errors to stderr

This commit is contained in:
Alex Barney 2019-03-08 14:55:31 -06:00
parent 12ec4c7966
commit 474e1e031e

View file

@ -16,15 +16,15 @@ namespace hactoolnet
catch (MissingKeyException ex)
{
string name = ex.Type == KeyType.Title ? $"Title key for rights ID {ex.Name}" : ex.Name;
Console.WriteLine($"\nERROR: {ex.Message}\nA required key is missing.\nKey name: {name}\n");
Console.Error.WriteLine($"\nERROR: {ex.Message}\nA required key is missing.\nKey name: {name}\n");
}
catch (Exception ex)
{
Console.WriteLine($"\nERROR: {ex.Message}\n");
Console.Error.WriteLine($"\nERROR: {ex.Message}\n");
Console.WriteLine("Additional information:");
Console.WriteLine(ex.GetType().FullName);
Console.WriteLine(ex.StackTrace);
Console.Error.WriteLine("Additional information:");
Console.Error.WriteLine(ex.GetType().FullName);
Console.Error.WriteLine(ex.StackTrace);
}
return 1;