* limitations under the License.
*/
-#include <stdio.h>
-#include <string.h>
+#include <sstream>
#include <dlog.h>
#include "CAudioIODef.h"
CAudioError::CAudioError(EError err, const char* msg, const char* file, const char* func, int line) :
__mError(err),
__mFullMsg(msg) {
- char __mErrorMsg[MSG_LENGTH] = { 0, };
+ ostringstream stringStream;
- snprintf(__mErrorMsg, MSG_LENGTH, "[%s|%s|%s(%d)|"
- COLOR_CYAN "%s" COLOR_END "]",
- __convertErrorToString(__mError), file, func, line, msg);
-
- __mFullMsg = std::runtime_error{__mErrorMsg};
+ stringStream << "[ " << __convertErrorToString(__mError)
+ << " | "<< file << ": " << func << "(" << line << ") | " << msg << " ]";
+ __mFullMsg = runtime_error{stringStream.str()};
}
const char *CAudioError::what() const noexcept {