mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Use switch
This commit is contained in:
@ -37,24 +37,27 @@ namespace osu.Game.Utils
|
|||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
{
|
{
|
||||||
if (exception is IOException ioe)
|
switch (exception)
|
||||||
{
|
{
|
||||||
// disk full exceptions, see https://stackoverflow.com/a/9294382
|
case IOException ioe:
|
||||||
const int hr_error_handle_disk_full = unchecked((int)0x80070027);
|
// disk full exceptions, see https://stackoverflow.com/a/9294382
|
||||||
const int hr_error_disk_full = unchecked((int)0x80070070);
|
const int hr_error_handle_disk_full = unchecked((int)0x80070027);
|
||||||
|
const int hr_error_disk_full = unchecked((int)0x80070070);
|
||||||
|
|
||||||
if (ioe.HResult == hr_error_handle_disk_full || ioe.HResult == hr_error_disk_full)
|
if (ioe.HResult == hr_error_handle_disk_full || ioe.HResult == hr_error_disk_full)
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exception is WebException we)
|
|
||||||
{
|
|
||||||
switch (we.Status)
|
|
||||||
{
|
|
||||||
// more statuses may need to be blocked as we come across them.
|
|
||||||
case WebExceptionStatus.Timeout:
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WebException we:
|
||||||
|
switch (we.Status)
|
||||||
|
{
|
||||||
|
// more statuses may need to be blocked as we come across them.
|
||||||
|
case WebExceptionStatus.Timeout:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// since we let unhandled exceptions go ignored at times, we want to ensure they don't get submitted on subsequent reports.
|
// since we let unhandled exceptions go ignored at times, we want to ensure they don't get submitted on subsequent reports.
|
||||||
|
Reference in New Issue
Block a user