wmail: bumped to 2.1.
[dockapps.git] / wmmixer / exception.cc
bloba4fa261c5d46214c9d09b17d9f8e15a43d85416d
1 // wmmixer - A mixer designed for WindowMaker
2 //
3 // Release 1.5
4 // Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
5 // Copyright (C) 2002 Gordon Fraser <gordon@debian.org>
6 // This software comes with ABSOLUTELY NO WARRANTY
7 // This software is free software, and you are welcome to redistribute it
8 // under certain conditions
9 // See the COPYING file for details.
11 #include "exception.h"
14 //--------------------------------------------------------------------
15 Exception::Exception()
17 error_message_ = NULL;
20 //--------------------------------------------------------------------
21 Exception::Exception(const Exception& exc)
23 char* other_message = exc.getErrorMessage();
25 if(other_message != NULL)
27 error_message_ = new char[strlen(other_message)+1];
28 strcpy(error_message_, other_message);
30 else
31 error_message_ = NULL;
34 //--------------------------------------------------------------------
35 Exception::~Exception()
37 if(error_message_ != NULL)
38 delete[] error_message_;
41 //--------------------------------------------------------------------
42 char* Exception::getErrorMessage() const
44 return error_message_;
47 //--------------------------------------------------------------------
48 MixerDeviceException::MixerDeviceException(char* device)
50 error_message_ = new char[256];
51 strcpy(error_message_, "Unable to open mixer device ");
52 strcat(error_message_, device);