mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Merge branch 'master' into skinning-test
This commit is contained in:
commit
dae17482fa
@ -107,6 +107,8 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
private class SkinDropdownControl : DropdownControl
|
private class SkinDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(SkinInfo item) => item.ToString();
|
protected override string GenerateItemText(SkinInfo item) => item.ToString();
|
||||||
|
|
||||||
|
protected override DropdownMenu CreateMenu() => base.CreateMenu().With(m => m.MaxHeight = 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using SharpRaven;
|
using SharpRaven;
|
||||||
@ -36,22 +37,13 @@ namespace osu.Game.Utils
|
|||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
{
|
{
|
||||||
if (exception is IOException ioe)
|
if (!shouldSubmitException(exception))
|
||||||
{
|
return;
|
||||||
// disk full exceptions, see https://stackoverflow.com/a/9294382
|
|
||||||
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)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.
|
||||||
if (lastException != null &&
|
if (lastException != null &&
|
||||||
lastException.Message == exception.Message && exception.StackTrace.StartsWith(lastException.StackTrace))
|
lastException.Message == exception.Message && exception.StackTrace.StartsWith(lastException.StackTrace))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
lastException = exception;
|
lastException = exception;
|
||||||
queuePendingTask(raven.CaptureAsync(new SentryEvent(exception) { Message = entry.Message }));
|
queuePendingTask(raven.CaptureAsync(new SentryEvent(exception) { Message = entry.Message }));
|
||||||
@ -61,6 +53,34 @@ namespace osu.Game.Utils
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool shouldSubmitException(Exception exception)
|
||||||
|
{
|
||||||
|
switch (exception)
|
||||||
|
{
|
||||||
|
case IOException ioe:
|
||||||
|
// disk full exceptions, see https://stackoverflow.com/a/9294382
|
||||||
|
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)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WebException we:
|
||||||
|
switch (we.Status)
|
||||||
|
{
|
||||||
|
// more statuses may need to be blocked as we come across them.
|
||||||
|
case WebExceptionStatus.Timeout:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void queuePendingTask(Task<string> task)
|
private void queuePendingTask(Task<string> task)
|
||||||
{
|
{
|
||||||
lock (tasks) tasks.Add(task);
|
lock (tasks) tasks.Add(task);
|
||||||
|
Loading…
Reference in New Issue
Block a user