Capture des exceptions pour la lecture du fichier
This commit is contained in:
parent
25287bcc4b
commit
a8e325cb20
|
@ -12,6 +12,7 @@ int main() {
|
|||
Manager manager;
|
||||
std::shared_ptr<Game> game = std::shared_ptr<Game>(new Game(manager));
|
||||
|
||||
try {
|
||||
// ouverture du niveau
|
||||
std::ifstream file;
|
||||
file.open("./levels/level1.dat", std::ios::binary | std::ios::in);
|
||||
|
@ -19,11 +20,8 @@ int main() {
|
|||
file.close();
|
||||
|
||||
manager.setView(game);
|
||||
|
||||
try {
|
||||
manager.start();
|
||||
} 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;
|
||||
|
|
Loading…
Reference in New Issue