Skip to content

Commit

Permalink
Catch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Nov 5, 2021
1 parent 0689839 commit 12d230d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion TVRename/ItemsAndActions/ItemMissing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace TVRename
{
using Alphaleonis.Win32.Filesystem;
using System;

public abstract class ItemMissing : Item
{
Expand All @@ -22,7 +23,14 @@ public abstract class ItemMissing : Item
[NotNull]
public override string ScanListViewGroup => "lvgActionMissing";
public override string DestinationFolder => Folder;
public override string TargetFolder => new FileInfo(TheFileNoExt).DirectoryName;
public override string TargetFolder
{
get
{
try { return new FileInfo(TheFileNoExt).DirectoryName; }
catch (NotSupportedException nse) { return string.Empty; }
}
}
public override int IconNumber => 1;
public abstract bool DoRename { get; }
public abstract MediaConfiguration Show { get; }
Expand Down
7 changes: 7 additions & 0 deletions TVRename/Sources/TMDB/LocalCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using TMDbLib.Objects.Trending;
using TMDbLib.Objects.TvShows;
using TVRename.Forms;
using static TVRename.TMDB.API;
using Cast = TMDbLib.Objects.Movies.Cast;
using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo;

Expand Down Expand Up @@ -341,6 +342,12 @@ public bool GetUpdates(bool showErrorMsgBox, CancellationToken cts, [NotNull] IE
LOGGER.Warn(LastErrorMessage);
return false;
}
catch (TooManyCallsException tce)
{
LastErrorMessage = "Too Many Calls Made - cancelled";
LOGGER.Warn(LastErrorMessage);
return false;
}
finally
{
SayNothing();
Expand Down

0 comments on commit 12d230d

Please sign in to comment.