]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/config/exception/MissingFieldConfigException.php
Move config exception to dedicated classes with proper namespace
[github/shaarli/Shaarli.git] / application / config / exception / MissingFieldConfigException.php
diff --git a/application/config/exception/MissingFieldConfigException.php b/application/config/exception/MissingFieldConfigException.php
new file mode 100644 (file)
index 0000000..6346c6a
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+
+namespace Shaarli\Config\Exception;
+
+/**
+ * Exception used if a mandatory field is missing in given configuration.
+ */
+class MissingFieldConfigException extends \Exception
+{
+    public $field;
+
+    /**
+     * Construct exception.
+     *
+     * @param string $field field name missing.
+     */
+    public function __construct($field)
+    {
+        $this->field = $field;
+        $this->message = 'Configuration value is required for '. $this->field;
+    }
+}