db/simple: migrate Mount() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-10-29 10:56:31 +02:00
parent fac8edd47a
commit df142d4f61
3 changed files with 8 additions and 16 deletions

View File

@@ -24,7 +24,6 @@
#include "Request.hxx"
#include "CommandError.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "util/ConstBuffer.hxx"
#include "fs/Traits.hxx"
#include "client/Client.hxx"
@@ -211,11 +210,7 @@ handle_mount(Client &client, Request args, Response &r)
SimpleDatabase &db = *(SimpleDatabase *)_db;
try {
Error error;
if (!db.Mount(local_uri, remote_uri, error)) {
composite.Unmount(local_uri);
return print_error(r, error);
}
db.Mount(local_uri, remote_uri);
} catch (...) {
composite.Unmount(local_uri);
throw;