mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-02-01 05:04:20 +01:00
Handle legitimate exception for "expected" failures
This commit is contained in:
parent
ec0a84283b
commit
8cc45ed6b4
|
|
@ -105,5 +105,13 @@ namespace CommonHelpers
|
|||
scope.SetTag("type", type);
|
||||
});
|
||||
}
|
||||
|
||||
public static void DebugException(String type, Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DebugException(String type, Object? name, Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,11 @@ namespace SteamController.Devices
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TraceException("STEAM", "Update", e);
|
||||
// Steam have disconnected device, which triggered exception
|
||||
if (e.Message == "Could not send report to hid device. Error: -1")
|
||||
DebugException("STEAM", "Update", e);
|
||||
else
|
||||
TraceException("STEAM", "Update", e);
|
||||
Fail();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,11 @@ namespace SteamController.Devices
|
|||
catch (System.ComponentModel.Win32Exception e)
|
||||
{
|
||||
// This is expected exception (as sometimes device will fail to connect)
|
||||
TraceException("X360", "ConnectExpected", e);
|
||||
// ERROR_SUCCESS, which likely means COM did not succeed
|
||||
if (e.NativeErrorCode == 0)
|
||||
DebugException("X360", "ConnectExpected", e);
|
||||
else
|
||||
TraceException("X360", "ConnectExpected", e);
|
||||
Fail();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,6 +340,12 @@ namespace SteamController.Helpers
|
|||
File.Copy(configPath + ".orig", configPath, true);
|
||||
return true;
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
// File was not found (which is valid as it might be before first start of the application)
|
||||
Log.DebugException("STEAM", e);
|
||||
return false;
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// Steam was installed, but got removed
|
||||
|
|
|
|||
Loading…
Reference in a new issue