-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from NerosoftDev/develop
Develop
- Loading branch information
Showing
27 changed files
with
245 additions
and
227 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
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
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
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
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
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 |
---|---|---|
@@ -1,68 +1,68 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Nerosoft.Euonia.Core; | ||
namespace Nerosoft.Euonia.Core; | ||
|
||
/// <summary> | ||
/// Represents errors that occur during business logic execution. | ||
/// </summary> | ||
[Serializable] | ||
public class BusinessException : Exception | ||
{ | ||
private readonly string _code; | ||
private readonly string _code; | ||
|
||
/// <summary> | ||
/// Gets the business error code. | ||
/// </summary> | ||
public virtual string Code => _code; | ||
/// <summary> | ||
/// Gets the business error code. | ||
/// </summary> | ||
public virtual string Code => _code; | ||
|
||
/// <inheritdoc /> | ||
public BusinessException() | ||
{ | ||
} | ||
/// <inheritdoc /> | ||
public BusinessException() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
public BusinessException(string code) | ||
{ | ||
_code = code; | ||
} | ||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
public BusinessException(string code) | ||
{ | ||
_code = code; | ||
} | ||
|
||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code and message. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
/// <param name="message">The error message.</param> | ||
public BusinessException(string code, string message) | ||
: base(message) | ||
{ | ||
_code = code; | ||
} | ||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code and message. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
/// <param name="message">The error message.</param> | ||
public BusinessException(string code, string message) | ||
: base(message) | ||
{ | ||
_code = code; | ||
} | ||
|
||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code, message and inner exception. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
/// <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.</param> | ||
public BusinessException(string code, string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
_code = code; | ||
} | ||
/// <summary> | ||
/// Initialize a new instance of the <see cref="BusinessException"/> with error code, message and inner exception. | ||
/// </summary> | ||
/// <param name="code">The error code.</param> | ||
/// <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.</param> | ||
public BusinessException(string code, string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
_code = code; | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected BusinessException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
_code = info.GetString(nameof(Code)); | ||
} | ||
#if !NET8_0_OR_GREATER | ||
/// <inheritdoc /> | ||
public BusinessException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
_code = info.GetString(nameof(Code)); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
info.AddValue(nameof(Code), _code, typeof(string)); | ||
} | ||
} | ||
/// <inheritdoc /> | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
info.AddValue(nameof(Code), _code, typeof(string)); | ||
} | ||
#endif | ||
} |
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
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
Oops, something went wrong.