mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
Added tools/str_exception.h and better error handling for StdStream and FileStream
This commit is contained in:
parent
5e70bc7bd7
commit
86089816a7
6 changed files with 44 additions and 56 deletions
|
@ -1,25 +1,12 @@
|
|||
#include "audiere_source.h"
|
||||
|
||||
#include "../../stream/clients/audiere_file.h"
|
||||
#include "../../tools/str_exception.h"
|
||||
|
||||
using namespace Mangle::Stream;
|
||||
|
||||
// Exception handling
|
||||
class Audiere_Exception : public std::exception
|
||||
{
|
||||
std::string msg;
|
||||
|
||||
public:
|
||||
|
||||
Audiere_Exception(const std::string &m) : msg(m) {}
|
||||
~Audiere_Exception() throw() {}
|
||||
virtual const char* what() const throw() { return msg.c_str(); }
|
||||
};
|
||||
|
||||
static void fail(const std::string &msg)
|
||||
{
|
||||
throw Audiere_Exception("Audiere exception: " + msg);
|
||||
}
|
||||
{ throw str_exception("Audiere exception: " + msg); }
|
||||
|
||||
using namespace audiere;
|
||||
using namespace Mangle::Sound;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue