archive/Plugin: migrate open() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 18:34:55 +02:00
parent fc7d3f64c0
commit 220d9528a3
9 changed files with 27 additions and 49 deletions

View File

@@ -20,20 +20,15 @@
#include "config.h"
#include "ArchivePlugin.hxx"
#include "fs/Path.hxx"
#include "util/Error.hxx"
#include <assert.h>
ArchiveFile *
archive_file_open(const ArchivePlugin *plugin, Path path,
Error &error)
archive_file_open(const ArchivePlugin *plugin, Path path)
{
assert(plugin != nullptr);
assert(plugin->open != nullptr);
assert(!path.IsNull());
ArchiveFile *file = plugin->open(path, error);
assert((file == nullptr) == error.IsDefined());
return file;
return plugin->open(path);
}