diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-07 09:07:50 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-07 09:07:50 +0100 |
commit | 4aab97ccb140cb098e93de4d67944e2df07c6af7 (patch) | |
tree | 1eaf4daa95c25aec9fa60195d7a6812b60bf7ffb /src/config/Block.cxx | |
parent | 4cd21f1e072d4219b44a54d5e6e62c6294c9a236 (diff) |
config/Path: throw std::runtime_error on error
Diffstat (limited to 'src/config/Block.cxx')
-rw-r--r-- | src/config/Block.cxx | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/config/Block.cxx b/src/config/Block.cxx index 96b91ee18..b9eaf3ebc 100644 --- a/src/config/Block.cxx +++ b/src/config/Block.cxx @@ -24,7 +24,6 @@ #include "system/FatalError.hxx" #include "fs/AllocatedPath.hxx" #include "util/RuntimeError.hxx" -#include "util/Error.hxx" #include <assert.h> #include <stdlib.h> @@ -94,12 +93,10 @@ ConfigBlock::GetBlockValue(const char *name, const char *default_value) const AllocatedPath ConfigBlock::GetPath(const char *name, const char *default_value) const { - int line2 = line; const char *s; const BlockParam *bp = GetBlockParam(name); if (bp != nullptr) { - line2 = bp->line; s = bp->value.c_str(); } else { if (default_value == nullptr) @@ -108,13 +105,7 @@ ConfigBlock::GetPath(const char *name, const char *default_value) const s = default_value; } - Error error; - AllocatedPath path = ParsePath(s, error); - if (gcc_unlikely(path.IsNull())) - throw FormatRuntimeError("Invalid path in \"%s\" at line %i: %s", - name, line2, error.GetMessage()); - - return path; + return ParsePath(s); } int |