mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
CA2201: throw correct exception type.
This commit is contained in:
@ -122,7 +122,7 @@ namespace osu.Game.Online.API
|
||||
// attempt to decode a displayable error string.
|
||||
var error = JsonConvert.DeserializeObject<DisplayableError>(responseString);
|
||||
if (error != null)
|
||||
e = new Exception(error.ErrorMessage, e);
|
||||
e = new APIException(error.ErrorMessage, e);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -154,6 +154,14 @@ namespace osu.Game.Online.API
|
||||
}
|
||||
}
|
||||
|
||||
public class APIException : InvalidOperationException
|
||||
{
|
||||
public APIException(string messsage, Exception innerException)
|
||||
: base(messsage, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void APIFailureHandler(Exception e);
|
||||
|
||||
public delegate void APISuccessHandler();
|
||||
|
Reference in New Issue
Block a user