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 @@
#include "config.h"
#include "Error.hxx"
#include "Domain.hxx"
#include "util/Error.hxx"
#include "util/RuntimeError.hxx"
#include <pulse/context.h>
#include <pulse/error.h>
void
SetPulseError(Error &error, pa_context *context, const char *prefix)
std::runtime_error
MakePulseError(pa_context *context, const char *prefix)
{
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 @@
#ifndef MPD_PULSE_ERROR_HXX
#define MPD_PULSE_ERROR_HXX
class Error;
#include <stdexcept>
struct pa_context;
void
SetPulseError(Error &error, pa_context *context, const char *prefix);
std::runtime_error
MakePulseError(pa_context *context, const char *prefix);
#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