Commit 6ead9750 authored by Max Kellermann's avatar Max Kellermann

output/pulse: migrate from class Error to C++ exceptions

parent 6532c7e0
...@@ -19,15 +19,14 @@ ...@@ -19,15 +19,14 @@
#include "config.h" #include "config.h"
#include "Error.hxx" #include "Error.hxx"
#include "Domain.hxx" #include "util/RuntimeError.hxx"
#include "util/Error.hxx"
#include <pulse/context.h> #include <pulse/context.h>
#include <pulse/error.h> #include <pulse/error.h>
void std::runtime_error
SetPulseError(Error &error, pa_context *context, const char *prefix) MakePulseError(pa_context *context, const char *prefix)
{ {
const int e = pa_context_errno(context); const int e = pa_context_errno(context);
error.Format(pulse_domain, e, "%s: %s", prefix, pa_strerror(e)); return FormatRuntimeError("%s: %s", prefix, pa_strerror(e));
} }
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
#ifndef MPD_PULSE_ERROR_HXX #ifndef MPD_PULSE_ERROR_HXX
#define MPD_PULSE_ERROR_HXX #define MPD_PULSE_ERROR_HXX
class Error; #include <stdexcept>
struct pa_context; struct pa_context;
void std::runtime_error
SetPulseError(Error &error, pa_context *context, const char *prefix); MakePulseError(pa_context *context, const char *prefix);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment