-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(simplifier): added options validation
- Loading branch information
Showing
6 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
Runtime/Exceptions/ValidateSimplificationOptionsException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
|
||
namespace UnityMeshSimplifier | ||
{ | ||
/// <summary> | ||
/// An exception thrown when validating simplification options. | ||
/// </summary> | ||
public sealed class ValidateSimplificationOptionsException : Exception | ||
{ | ||
private readonly string propertyName; | ||
|
||
/// <summary> | ||
/// Creates a new simplification options validation exception. | ||
/// </summary> | ||
/// <param name="propertyName">The property name.</param> | ||
/// <param name="message">The exception message.</param> | ||
public ValidateSimplificationOptionsException(string propertyName, string message) | ||
: base(message) | ||
{ | ||
this.propertyName = propertyName; | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new simplification options validation exception. | ||
/// </summary> | ||
/// <param name="propertyName">The property name.</param> | ||
/// <param name="message">The exception message.</param> | ||
/// <param name="innerException">The exception that caused the validation error.</param> | ||
public ValidateSimplificationOptionsException(string propertyName, string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
this.propertyName = propertyName; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the property name that caused the validation error. | ||
/// </summary> | ||
public string PropertyName | ||
{ | ||
get { return propertyName; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets the message of the exception. | ||
/// </summary> | ||
public override string Message | ||
{ | ||
get { return base.Message + Environment.NewLine + "Property name: " + propertyName; } | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Runtime/Exceptions/ValidateSimplificationOptionsException.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters