trainings/CreatingReliableSoftwareCpp/Presentation/exercises/exception
2024-05-06 11:58:30 +02:00
..
soulutions Reliable - pierwszy commit 2024-05-06 11:58:30 +02:00
CMakeLists.txt Reliable - pierwszy commit 2024-05-06 11:58:30 +02:00
main.cpp Reliable - pierwszy commit 2024-05-06 11:58:30 +02:00
README.md Reliable - pierwszy commit 2024-05-06 11:58:30 +02:00

Linux compilation

> mkdir build
> cd build
> cmake -DCMAKE_BUILD_TYPE=Debug ..
> make

Exercise 1

  • Create an exception class Exception which inherits from std::exceptionand two classesParserExceptionandReaderExceptionwhich inherit form classException`.
  • Rewrite a code to ParserException in the method parse and ReaderException in the method read.
  • Try to catch errors in main and print them
  • Rewrite a code once again and return nullopt when an error occurs instead of throwing an exception