output/pulse: migrate from class Error to C++ exceptions
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user