mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Use a custom channel not found exception.
This commit is contained in:
@ -60,7 +60,7 @@ namespace osu.Game.Online.Chat
|
||||
throw new ArgumentNullException(nameof(name));
|
||||
|
||||
CurrentChannel.Value = AvailableChannels.FirstOrDefault(c => c.Name == name)
|
||||
?? throw new ArgumentException($"Channel {name} was not found.");
|
||||
?? throw new ChannelNotFoundException(name);
|
||||
}
|
||||
|
||||
public void OpenUserChannel(User user)
|
||||
@ -298,4 +298,14 @@ namespace osu.Game.Online.Chat
|
||||
api.Register(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ChannelNotFoundException : Exception
|
||||
{
|
||||
public ChannelNotFoundException(string channelName)
|
||||
: base($"A channel with the name {channelName} could not be found.")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user