mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 04:53:12 +08:00
exception handling
This commit is contained in:
parent
ce6a87b4a3
commit
5d64c1b7bf
@ -124,8 +124,15 @@ namespace osu.Game.Database
|
|||||||
cancellationToken == CancellationToken.None ? notification.CancellationToken : cancellationToken).ConfigureAwait(false);
|
cancellationToken == CancellationToken.None ? notification.CancellationToken : cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch
|
||||||
{
|
{
|
||||||
|
notification.State = ProgressNotificationState.Cancelled;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// Determines whether to export repeatedly, so he must be removed from the list at the end whether there is a error.
|
||||||
|
exporting_models.Remove(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup if export is failed or canceled.
|
// cleanup if export is failed or canceled.
|
||||||
@ -141,7 +148,6 @@ namespace osu.Game.Database
|
|||||||
notification.State = ProgressNotificationState.Completed;
|
notification.State = ProgressNotificationState.Completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
exporting_models.Remove(model);
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +177,7 @@ namespace osu.Game.Database
|
|||||||
if (t.IsFaulted)
|
if (t.IsFaulted)
|
||||||
{
|
{
|
||||||
Logger.Error(t.Exception, "An error occurred while exporting", LoggingTarget.Database);
|
Logger.Error(t.Exception, "An error occurred while exporting", LoggingTarget.Database);
|
||||||
return false;
|
throw t.Exception!;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user