Skip to content

Commit

Permalink
Logged exceptions caught by MainViewModel.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcclive committed May 5, 2021
1 parent 0e2eed1 commit c9c0000
Showing 1 changed file with 60 additions and 12 deletions.
72 changes: 60 additions & 12 deletions Tricycle.UI/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ async Task SelectDestination()
_configManager.Config.DestinationDirectory = Path.GetDirectoryName(result.FileName);
_configManager.Save();
}
catch (ArgumentException) { }
catch (ArgumentException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}

DestinationName = result.FileName;
Expand Down Expand Up @@ -1180,8 +1184,11 @@ string GetDefaultDestinationName(MediaInfo sourceInfo, string extension)
{
Path.Combine(directory, fileName);
}
catch (ArgumentException)
catch (ArgumentException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);

directory = null;
}
}
Expand Down Expand Up @@ -1355,9 +1362,22 @@ void StartTranscode()

success = true;
}
catch (ArgumentException) { }
catch (NotSupportedException) { }
catch (InvalidOperationException) { }
catch (ArgumentException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (NotSupportedException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (InvalidOperationException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}


if (!success)
{
Expand Down Expand Up @@ -1392,9 +1412,21 @@ void StopTranscode()

success = true;
}
catch (ArgumentException) { }
catch (NotSupportedException) { }
catch (InvalidOperationException) { }
catch (ArgumentException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (NotSupportedException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (InvalidOperationException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}

if (!success)
{
Expand Down Expand Up @@ -1436,10 +1468,26 @@ void DeleteDestination()
_fileSystem.File.Delete(DestinationName);
}
}
catch (ArgumentException) { }
catch (NotSupportedException) { }
catch (IOException) { }
catch (UnauthorizedAccessException) { }
catch (ArgumentException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (NotSupportedException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (IOException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
catch (UnauthorizedAccessException ex)
{
Trace.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}

TranscodeJob CreateJob()
Expand Down

0 comments on commit c9c0000

Please sign in to comment.