diff --git a/src/rt_audio.cpp b/src/rt_audio.cpp index 8e2d87d..9b20acc 100644 --- a/src/rt_audio.cpp +++ b/src/rt_audio.cpp @@ -1,7 +1,7 @@ #include "rt_audio.h" #include -#include +#include #include "rt_audio_converter.h" @@ -656,9 +656,13 @@ void RtAudioWrap::checkRtAudio(const RtAudioErrorType error, return; } - throw Napi::Error::New(env, - std::format( - "RtAudio Error: Code: {}, Message: '{}'", - static_cast(error), - _rtAudio->getErrorText())); + std::stringstream ss; + + ss << "RtAudio Error: Code: "; + ss << static_cast(error); + ss << ", Message: '"; + ss << _rtAudio->getErrorText(); + ss << "'"; + + throw Napi::Error::New(env, ss.str()); }