config/Block: GetPath() throws exception on error
This commit is contained in:
@@ -85,12 +85,9 @@ static bool
|
||||
sidplay_init(const ConfigBlock &block)
|
||||
{
|
||||
/* read the songlengths database file */
|
||||
Error error;
|
||||
const auto database_path = block.GetPath("songlength_database", error);
|
||||
const auto database_path = block.GetPath("songlength_database");
|
||||
if (!database_path.IsNull())
|
||||
songlength_database = sidplay_load_songlength_db(database_path);
|
||||
else if (error.IsDefined())
|
||||
FatalError(error);
|
||||
|
||||
default_songlength = block.GetBlockValue("default_songlength", 0u);
|
||||
|
||||
|
@@ -40,13 +40,9 @@ static constexpr unsigned WILDMIDI_SAMPLE_RATE = 48000;
|
||||
static bool
|
||||
wildmidi_init(const ConfigBlock &block)
|
||||
{
|
||||
Error error;
|
||||
const AllocatedPath path =
|
||||
block.GetPath("config_file",
|
||||
"/etc/timidity/timidity.cfg",
|
||||
error);
|
||||
if (path.IsNull())
|
||||
FatalError(error);
|
||||
"/etc/timidity/timidity.cfg");
|
||||
|
||||
if (!FileExists(path)) {
|
||||
const auto utf8 = path.ToUTF8();
|
||||
|
Reference in New Issue
Block a user