Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a static Error method in Result<T> and Result classes that accepts an Error object #223

Open
jocifer93 opened this issue Dec 2, 2024 · 1 comment

Comments

@jocifer93
Copy link

jocifer93 commented Dec 2, 2024

It would be helpful to have an Error class similar to the existing ValidationError class, which can be used to encapsulate error details. Something like this:

public class Error
{
    public string Message { get; set; }
    public string Code { get; set; }
}

Additionally, it would be great to add a static Error method in both the Result<T> and Result classes that accepts an Error object.

@savornicesei
Copy link

Actually it would simplify things if the 2 lists of errors will be merged into a single list of type

Error(ErrorType type, string code, int severity, string description)
public partial enum ErrorType{
 Validation,
 Execution,
 Custom
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants