#ifndef PURCHASE_ERROR_HH #define PURCHASE_ERROR_HH #include namespace book_store { class purchase_error { public: enum purchase_error_type { person_not_found, book_not_found, not_enough_stock, }; private: purchase_error_type _error; public: purchase_error(purchase_error_type error) : _error(error) {} [[nodiscard]] auto error() const noexcept -> purchase_error_type; [[nodiscard]] auto what() const noexcept -> std::string_view; }; } // namespace book_store #endif // PURCHASE_ERROR_HH