ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
UserError.hpp File Reference

Exception type for user-facing input validation errors. More...

#include <stdexcept>
#include <string>

Go to the source code of this file.

Classes

class  ppforest2::UserError
 Exception for user-facing input validation errors. More...
 

Namespaces

namespace  ppforest2
 

Functions

void ppforest2::user_error (bool condition, char const *message)
 Throw a UserError if the condition is false.
 
void ppforest2::user_error (bool condition, std::string const &message)
 Throw a UserError if the condition is false.
 

Detailed Description

Exception type for user-facing input validation errors.

Use user_error() when the error is caused by invalid user input (bad CSV data, wrong parameters, missing files). These produce actionable error messages rather than assertion-style crashes.

Use invariant() for programmer bugs (conditions that should never happen if the code is correct).