Skip to content

Commit c79a437

Browse files
committed
refactor: exceptions directory
The exceptions directory was renamed from exception to exceptions.
1 parent 0cc8365 commit c79a437

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)