Description
The task of this issue is simple. There is a GraphExceptions.hpp
file present for you to use. You need to use the available exception classes from the GraphExceptions.hpp
file and use those exception classes in the GraphMatrix.hpp
. All the methods of the GraphMatrix
class throws a basic exception whenever something unexpected occurs.
For example the getEdge
function throws a std::runtime_error
here, If the edge is not found between the vertices.
You need to replace it with the appropriate and suitable exception from the GraphExceptions.hpp
and in this case the std::runtime_error
can be replaced with the custom built EdgeNotFoundException
here.
Similarly you need to use all the classes available inside in the GraphExceptions.hpp
file.
Tasks
- Make sure you throw the below exceptions properly.
VertexNotFoundException
EdgeNotFoundException
DuplicateVertexException
InvalidEdgeOperationException
GraphOperationException
- Create an example file called
GraphMatrixExceptionHandling.cpp
in the examples folder of the repository, and make sure to incorporate the use of all the exception classes available in theGraphExceptions.hpp
- Make sure in the example file you are covering all the cases with appropriate error messages and you are handling them properly.
Important Note: While developing this feature depending on the use case you might have to develop new exception classes in the GraphExceptions.hpp
. So take this issue only if you think you can meet all the requirements mentioned in the issue.
Also make sure to read the updated contribution guidelines