Skip to content
Download

ConflictException

mach::ConflictException

Represents an HTTP 409 (Conflict) exception.

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.

Primary header:

#include <mach/exceptions/ConflictException.hpp>

Convenience header:

#include <mach/exceptions.hpp>
class ConflictException final : public HttpException {
public:
explicit ConflictException(
std::string message =
"The request could not be completed because of a resource conflict."
);
};
Property Value
Code 409
Status Conflict

ConflictException inherits the public member functions of HttpException.

The exception message defaults to "The request could not be completed because of a resource conflict." when no message is provided.

throw mach::ConflictException();
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.