mirror of
https://github.com/EnderIce2/SDR-RPC.git
synced 2025-07-12 02:39:13 +00:00
First commit
This commit is contained in:
15
DiscordAPI/Exceptions/BadPresenceException.cs
Normal file
15
DiscordAPI/Exceptions/BadPresenceException.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordRPC.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// A BadPresenceException is thrown when invalid, incompatible or conflicting properties and is unable to be sent.
|
||||
/// </summary>
|
||||
public class BadPresenceException : Exception
|
||||
{
|
||||
internal BadPresenceException(string message) : base(message) { }
|
||||
}
|
||||
}
|
15
DiscordAPI/Exceptions/InvalidConfigurationException.cs
Normal file
15
DiscordAPI/Exceptions/InvalidConfigurationException.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordRPC.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// A InvalidConfigurationException is thrown when trying to perform a action that conflicts with the current configuration.
|
||||
/// </summary>
|
||||
public class InvalidConfigurationException : Exception
|
||||
{
|
||||
internal InvalidConfigurationException(string message) : base(message) { }
|
||||
}
|
||||
}
|
16
DiscordAPI/Exceptions/InvalidPipeException.cs
Normal file
16
DiscordAPI/Exceptions/InvalidPipeException.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordRPC.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// The exception that is thrown when a error occurs while communicating with a pipe or when a connection attempt fails.
|
||||
/// </summary>
|
||||
[System.Obsolete("Not actually used anywhere")]
|
||||
public class InvalidPipeException : Exception
|
||||
{
|
||||
internal InvalidPipeException(string message) : base(message) { }
|
||||
}
|
||||
}
|
50
DiscordAPI/Exceptions/StringOutOfRangeException.cs
Normal file
50
DiscordAPI/Exceptions/StringOutOfRangeException.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordRPC.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// A StringOutOfRangeException is thrown when the length of a string exceeds the allowed limit.
|
||||
/// </summary>
|
||||
public class StringOutOfRangeException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum length the string is allowed to be.
|
||||
/// </summary>
|
||||
public int MaximumLength { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Minimum length the string is allowed to be.
|
||||
/// </summary>
|
||||
public int MinimumLength { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new string out of range exception with a range of min to max and a custom message
|
||||
/// </summary>
|
||||
/// <param name="message">The custom message</param>
|
||||
/// <param name="min">Minimum length the string can be</param>
|
||||
/// <param name="max">Maximum length the string can be</param>
|
||||
internal StringOutOfRangeException(string message, int min, int max) : base(message)
|
||||
{
|
||||
MinimumLength = min;
|
||||
MaximumLength = max;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new sting out of range exception with a range of min to max
|
||||
/// </summary>
|
||||
/// <param name="minumum"></param>
|
||||
/// <param name="max"></param>
|
||||
internal StringOutOfRangeException(int minumum, int max)
|
||||
: this("Length of string is out of range. Expected a value between " + minumum + " and " + max, minumum, max) { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new sting out of range exception with a range of 0 to max
|
||||
/// </summary>
|
||||
/// <param name="max"></param>
|
||||
internal StringOutOfRangeException(int max)
|
||||
: this("Length of string is out of range. Expected a value with a maximum length of " + max, 0, max) { }
|
||||
}
|
||||
}
|
24
DiscordAPI/Exceptions/UninitializedException.cs
Normal file
24
DiscordAPI/Exceptions/UninitializedException.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordRPC.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Thrown when an action is performed on a client that has not yet been initialized
|
||||
/// </summary>
|
||||
public class UninitializedException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new unintialized exception
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
internal UninitializedException(string message) : base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new uninitialized exception with default message.
|
||||
/// </summary>
|
||||
internal UninitializedException() : this("Cannot perform action because the client has not been initialized yet or has been deinitialized.") { }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user