1<?php
2
3declare(strict_types=1);
4
5/*
6 * This file is a part of dflydev/dot-access-data.
7 *
8 * (c) Dragonfly Development Inc.
9 *
10 * For the full copyright and license information, please view the LICENSE
11 * file that was distributed with this source code.
12 */
13
14namespace Dflydev\DotAccessData\Exception;
15
16use Throwable;
17
18/**
19 * Thrown when trying to access a path that does not exist
20 */
21class MissingPathException extends DataException
22{
23    /** @var string */
24    protected $path;
25
26    public function __construct(string $path, string $message = '', int $code = 0, Throwable $previous = null)
27    {
28        $this->path = $path;
29
30        parent::__construct($message, $code, $previous);
31    }
32
33    public function getPath(): string
34    {
35        return $this->path;
36    }
37}
38