Skip to content

Create RestExceptions.FluentValidation #29

@Stratis-Dermanoutsos

Description

@Stratis-Dermanoutsos

For starters, handle ValidationException.

Quite easy to get the validator's message.

As for determining which type of RestException to throw, use ErrorCode, if possible.

RuleFor(x => x.Property)
    .WithErrorCode("400") // throws BadRequestRestException
    .WithErrorCode(nameof(BadRequestRestException)) // throws BadRequestRestException
    .WithErrorCode("BadRequest") // throws BadRequestRestException

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions