summaryrefslogtreecommitdiff
path: root/src/management/builder/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/management/builder/settings.cpp')
-rw-r--r--src/management/builder/settings.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/management/builder/settings.cpp b/src/management/builder/settings.cpp
index b682c49..bf345e7 100644
--- a/src/management/builder/settings.cpp
+++ b/src/management/builder/settings.cpp
@@ -4,6 +4,7 @@
#include "file/settings/settings.hpp"
#include "file/settings/checker_decorator.hpp"
#include "file/settings/file_decorator.hpp"
+#include "file/errors/not_create.hpp"
namespace smtp::manage::builder
{
@@ -17,12 +18,20 @@ namespace smtp::manage::builder
{
static const std::string PATH = "/var/lib/smtp/settings.txt";
- auto result = std::make_shared<file::settings::CheckerDecorator>(BuildErrorRegistrator());
- result->Apply(std::make_shared<file::settings::FileDecorator>(PATH));
+ auto result = std::make_shared<file::settings::CheckerDecorator>(BuildSettingsErrorRegistrator());
+ result->Apply(std::make_shared<file::settings::FileDecorator>(PATH, BuildFileErrorRegistrator(PATH)));
return result;
}
- checker::RegistratorSettings Settings::BuildErrorRegistrator() const
+ file::errors::Registrator Settings::BuildFileErrorRegistrator( std::string const& path ) const
+ {
+ file::errors::Registrator result;
+ auto not_created_file_error = std::make_shared<file::errors::NotCreatedFile>(path);
+ result.Add(not_created_file_error, ENOENT);
+ return result;
+ }
+
+ checker::RegistratorSettings Settings::BuildSettingsErrorRegistrator() const
{
checker::RegistratorSettings result;