NotFoundException
mach::NotFoundException
Represents an HTTP 404 (Not Found) exception.
Description
Section titled “Description”NotFoundException indicates that the requested resource could not be found. It is typically thrown when a requested entity or endpoint does not exist.
NotFoundException derives from HttpException.
Headers
Section titled “Headers”Primary header:
#include <mach/exceptions/NotFoundException.hpp>Convenience header:
#include <mach/exceptions.hpp>Syntax
Section titled “Syntax”class NotFoundException final : public HttpException {public: explicit NotFoundException( std::string message = "The requested resource was not found." );};HTTP Status
Section titled “HTTP Status”| Property | Value |
|---|---|
| Code | 404 |
| Status | Not Found |
Member Functions
Section titled “Member Functions”NotFoundException inherits the public member functions of HttpException.
Remarks
Section titled “Remarks”The exception message defaults to "The requested resource was not found." when no message is provided.
Example
Section titled “Example”throw mach::NotFoundException();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. |
ConflictException |
Represents an HTTP 409 Conflict. |