ConflictException
mach::ConflictException
Represents an HTTP 409 (Conflict) exception.
Description
Section titled “Description”ConflictException indicates that a request could not be completed because it conflicts with the current state of the target resource. It is typically thrown when attempting to create or modify a resource in a way that violates application rules or resource state.
ConflictException derives from HttpException.
Headers
Section titled “Headers”Primary header:
#include <mach/exceptions/ConflictException.hpp>Convenience header:
#include <mach/exceptions.hpp>Syntax
Section titled “Syntax”class ConflictException final : public HttpException {public: explicit ConflictException( std::string message = "The request could not be completed because of a resource conflict." );};HTTP Status
Section titled “HTTP Status”| Property | Value |
|---|---|
| Code | 409 |
| Status | Conflict |
Member Functions
Section titled “Member Functions”ConflictException inherits the public member functions of HttpException.
Remarks
Section titled “Remarks”The exception message defaults to "The request could not be completed because of a resource conflict." when no message is provided.
Example
Section titled “Example”throw mach::ConflictException();See Also
Section titled “See Also”| Name | Description |
|---|---|
HttpException |
Base class for Mach HTTP exceptions. |
BadRequestException |
Represents an HTTP 400 Bad Request. |
UnauthorizedException |
Represents an HTTP 401 Unauthorized. |
ForbiddenException |
Represents an HTTP 403 Forbidden. |
NotFoundException |
Represents an HTTP 404 Not Found. |