Skip to content

500 status code. #19

@Shaedar

Description

@Shaedar

In Connection.cs:

private void ThrowIfRequestFailed(IRestResponse response)
        {
            switch (response.StatusCode)
            {
                case HttpStatusCode.BadRequest:
                case HttpStatusCode.Forbidden:
                case HttpStatusCode.NotAcceptable:
                case HttpStatusCode.Unauthorized:
                case HttpStatusCode.UnsupportedMediaType:
                    throw new RequestFailedException(response);

                case HttpStatusCode.NotFound:
                    throw new RequestNotFoundException(response);
            }
       }

If you get a 500 from YouTrack (BadGateway, GatewayTimeout, HttpVersionNotSupported, InternalServerError, NotImplemented, ServiceUnavailable, etc) this will not count as a fail now?

Maybe there should be a default: in the switch case or more statuscodes added to it.

... Or maybe it works already and I just suck!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions