Skip to content

Commit

Permalink
Remove unneccesary exception code
Browse files Browse the repository at this point in the history
InvalidConfigException is used in exactly one place, and isn't meant to be used anywhere else (except in exception handling code)

Oh yeah, and there was also a leftover using in FanRPMConf that got removed too
  • Loading branch information
Sparronator9999 committed Dec 8, 2024
1 parent 5f7852b commit 58dbf66
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
1 change: 0 additions & 1 deletion YAMDCC.Config/FanRPMConf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License along with
// YAMDCC. If not, see <https://www.gnu.org/licenses/>.

using System;
using System.Xml.Serialization;

namespace YAMDCC.Config
Expand Down
32 changes: 1 addition & 31 deletions YAMDCC.Config/InvalidConfigException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,18 @@
// YAMDCC. If not, see <https://www.gnu.org/licenses/>.

using System;
using System.Runtime.Serialization;

namespace YAMDCC.Config
{
/// <summary>
/// The exception thrown when an invalid <see cref="YAMDCC_Config"/> is loaded.
/// </summary>
[Serializable]
public sealed class InvalidConfigException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="InvalidConfigException" /> class.
/// </summary>
public InvalidConfigException()
: base("The fan control config was not in an expected format.") { }

/// <summary>
/// Initializes a new instance of the <see cref="InvalidConfigException"/>
/// class with a specified error message.
/// </summary>
/// <param name="message">
/// The message that describes the error.
/// </param>
public InvalidConfigException(string message)
: base(message) { }

/// <summary>
/// Initializes a new instance of the <see cref="InvalidConfigException"/>
/// class with a specified error message and a reference to the inner
/// exception that is the cause of this exception.
/// </summary>
/// <param name="message">
/// The error message that explains the reason for the exception.
/// </param>
/// <param name="innerException">
/// The exception that is the cause of the current exception,
/// or <c>null</c> if no inner exception is specified.
/// </param>
public InvalidConfigException(string message, Exception innerException)
: base(message, innerException) { }

private InvalidConfigException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base("The YAMDCC config was not in the expected format.") { }
}
}

0 comments on commit 58dbf66

Please sign in to comment.