Last active
December 8, 2018 00:32
-
-
Save vkhorikov/552f106a9a2ca131be0b to your computer and use it in GitHub Desktop.
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
public abstract class Error | |
{ | |
public abstract ErrorType Type { get; } | |
} | |
public class SimpleError : Error | |
{ | |
public override ErrorType Type { get { return ErrorType.Simple; } } | |
public string Message { get; private set; } | |
public SimpleError(string message) | |
{ | |
Message = message; | |
} | |
} | |
public class UserNotFoundError : Error | |
{ | |
public override ErrorType Type { get { return ErrorType.UserNotFound; } } | |
public int UserId { get; private set; } | |
public UserNotFoundError(int userId) | |
{ | |
UserId = userId; | |
} | |
} | |
public enum ErrorType | |
{ | |
Simple, | |
UserNotFound | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment