Prise en charge propre des exceptions
This commit is contained in:
parent
586ba7ca10
commit
fbc43a400b
11
src/main.cpp
11
src/main.cpp
|
@ -2,6 +2,7 @@
|
||||||
#include "block.hpp"
|
#include "block.hpp"
|
||||||
#include "engine.hpp"
|
#include "engine.hpp"
|
||||||
#include "constants.hpp"
|
#include "constants.hpp"
|
||||||
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
@ -62,6 +63,14 @@ int main() {
|
||||||
engine.addObject(block21);
|
engine.addObject(block21);
|
||||||
engine.addObject(block22);
|
engine.addObject(block22);
|
||||||
|
|
||||||
|
try {
|
||||||
engine.start();
|
engine.start();
|
||||||
return 0;
|
} catch (const std::exception& exception) {
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "Le programme a quitté après une erreur d'exécution." << std::endl;
|
||||||
|
std::cerr << exception.what() << std::endl;
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue