aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-04-30 04:22:13 -0700
committerChris Robinson <[email protected]>2023-04-30 04:22:13 -0700
commitb64b500c6b75aebb3b5d1c41206317f81636a21c (patch)
tree92271958a92c1b37b47a9ebb0d098aabee065661 /alc/context.cpp
parent622ee190efffef9407ff63ffdbff6bbdbe0dce04 (diff)
Improve some debug error handling
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index 7fcb6539..6553f322 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -304,7 +304,7 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id,
DebugSeverity severity, ALsizei length, const char *message)
{
static_assert(DebugSeverityBase+DebugSeverityCount <= 32, "Too many debug bits");
- static auto get_source_enum = [](DebugSource source) noexcept
+ static auto get_source_enum = [](DebugSource source)
{
switch(source)
{
@@ -314,8 +314,9 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id,
case DebugSource::Application: return AL_DEBUG_SOURCE_APPLICATION_SOFT;
case DebugSource::Other: return AL_DEBUG_SOURCE_OTHER_SOFT;
}
+ throw std::runtime_error{"Unexpected debug source value "+std::to_string(al::to_underlying(source))};
};
- static auto get_type_enum = [](DebugType type) noexcept
+ static auto get_type_enum = [](DebugType type)
{
switch(type)
{
@@ -327,8 +328,9 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id,
case DebugType::Marker: return AL_DEBUG_TYPE_MARKER_SOFT;
case DebugType::Other: return AL_DEBUG_TYPE_OTHER_SOFT;
}
+ throw std::runtime_error{"Unexpected debug type value "+std::to_string(al::to_underlying(type))};
};
- static auto get_severity_enum = [](DebugSeverity severity) noexcept
+ static auto get_severity_enum = [](DebugSeverity severity)
{
switch(severity)
{
@@ -337,6 +339,7 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id,
case DebugSeverity::Low: return AL_DEBUG_SEVERITY_LOW_SOFT;
case DebugSeverity::Notification: return AL_DEBUG_SEVERITY_NOTIFICATION_SOFT;
}
+ throw std::runtime_error{"Unexpected debug severity value "+std::to_string(al::to_underlying(severity))};
};
std::lock_guard<std::mutex> _{mDebugCbLock};