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

FEATURE: Create HTTP Errors Easily in WebAssembly Project #150

Open
ElbekDeveloper opened this issue Jan 2, 2024 · 0 comments
Open

FEATURE: Create HTTP Errors Easily in WebAssembly Project #150

ElbekDeveloper opened this issue Jan 2, 2024 · 0 comments

Comments

@ElbekDeveloper
Copy link
Collaborator

Currently if you want to create exceptions for unit tests, when you are using WebAssembly library, you have to do the following:

public static TheoryData CriticalDependencyExceptions()
{
    string someMessage = GetRandomMessage();
    var someResponseMessage = new HttpResponseMessage();

    return new TheoryData<Xeption>()
    {
        new HttpResponseUrlNotFoundException(
            someResponseMessage,
            someMessage),

        new HttpResponseUnauthorizedException(
            someResponseMessage,
            someMessage),

        new HttpResponseForbiddenException(
            someResponseMessage,
            someMessage)
    };
}

At the same time Core project made it easier to create the above exceptions without response message and message.

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

Successfully merging a pull request may close this issue.

1 participant