Better error handling

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8811 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-06-04 00:17:22 +00:00
parent 9d52fa1e46
commit d56a729041
3 changed files with 10 additions and 3 deletions

View File

@ -85,7 +85,7 @@ GrandPrixLose::GrandPrixLose() : Screen("grand_prix_lose.stkgui")
}
catch (std::exception& e)
{
fprintf(stderr, "%s", e.what());
fprintf(stderr, "[GrandPrixLose] WARNING: exception caught when trying to load music: %s\n", e.what());
m_music = NULL;
}
} // GrandPrixLose

View File

@ -68,7 +68,7 @@ GrandPrixWin::GrandPrixWin() : Screen("grand_prix_win.stkgui")
}
catch (std::exception& e)
{
fprintf(stderr, "%s", e.what());
fprintf(stderr, "[GrandPrixWin] WARNING: exception caught when trying to load music: %s\n", e.what());
m_music = NULL;
}
} // GrandPrixWin

View File

@ -389,7 +389,14 @@ void RaceResultGUI::onUpdate(float dt, irr::video::IVideoDriver*)
if (m_finish_sound != NULL && m_finish_sound->getStatus() != SFXManager::SFX_PLAYING)
{
music_manager->startMusic( music_manager->getMusicInformation("race_summary.music") );
try
{
music_manager->startMusic( music_manager->getMusicInformation("race_summary.music") );
}
catch (std::exception& e)
{
fprintf(stderr, "[RaceResultGUI] WARNING: exception caught when trying to load music: %s\n", e.what());
}
}
} // onUpdate