We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cc8365 commit c79a437Copy full SHA for c79a437
src/Exceptions/CreateDirectoryException.php
@@ -0,0 +1,27 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+/*
6
+ * This file is part of https://github.com/josantonius/php-json repository.
7
+ *
8
+ * (c) Josantonius <hello@josantonius.dev>
9
10
+ * For the full copyright and license information, please view the LICENSE
11
+ * file that was distributed with this source code.
12
+ */
13
14
+namespace Josantonius\Json\Exceptions;
15
16
+class CreateDirectoryException extends \Exception
17
+{
18
+ public function __construct(string $path)
19
+ {
20
+ $lastError = error_get_last()['message'] ?? '';
21
22
+ $message = "Could not create directory in '$path'.";
23
+ $message .= $lastError ? " $lastError." : '';
24
25
+ parent::__construct($message);
26
+ }
27
+}
0 commit comments