qHexWalker 0.0.1
Hexagonal Grid Pathfinding & Maze Visualization on Interactive Maps
Loading...
Searching...
No Matches
pathfindingErrors.h File Reference

Error handling strategy for pathfinding algorithms. More...

#include <stdexcept>
#include <string>
+ Include dependency graph for pathfindingErrors.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PathfindingException
 Exception class for pathfinding errors. More...
 

Enumerations

enum class  PathfindingError {
  None = 0 , InvalidCell , SameStartEnd , BlockedStartCell ,
  BlockedEndCell , NoPathFound , ConversionError , CoordinateError ,
  MaxIterations , InternalError
}
 Error codes for pathfinding operations. More...
 

Functions

std::string pathfindingErrorToString (const PathfindingError error)
 Converts PathfindingError to human-readable string.
 

Detailed Description

Error handling strategy for pathfinding algorithms.

This file defines a consistent error handling approach across all pathfinding algorithms in the project.

Author
qHexWalker Team
Date
2025

Definition in file pathfindingErrors.h.

Enumeration Type Documentation

◆ PathfindingError

enum class PathfindingError
strong

Error codes for pathfinding operations.

Consistent error codes across all pathfinding algorithms (A*, Dijkstra, etc.)

Enumerator
None 

No error occurred.

InvalidCell 

One or both cells are invalid (H3_NULL or failed isValidCell)

SameStartEnd 

Start and end points are identical.

BlockedStartCell 

Start cell is blocked by an obstacle.

BlockedEndCell 

End cell is blocked by an obstacle.

NoPathFound 

No path exists between start and end (disconnected graph)

ConversionError 

Error converting between H3 resolutions.

CoordinateError 

Error getting cell coordinates.

MaxIterations 

Search exceeded maximum iteration limit.

InternalError 

Internal algorithm error.

Definition at line 24 of file pathfindingErrors.h.

Function Documentation

◆ pathfindingErrorToString()

std::string pathfindingErrorToString ( const PathfindingError  error)
inline

Converts PathfindingError to human-readable string.

Parameters
errorThe error code
Returns
String description of the error

Definition at line 42 of file pathfindingErrors.h.

References BlockedEndCell, BlockedStartCell, ConversionError, CoordinateError, InternalError, InvalidCell, MaxIterations, None, NoPathFound, and SameStartEnd.