diff --git a/src/Potter/Aware/AwareTrait.php b/src/Potter/Aware/AwareTrait.php index b11ad50..28bad07 100644 --- a/src/Potter/Aware/AwareTrait.php +++ b/src/Potter/Aware/AwareTrait.php @@ -14,7 +14,10 @@ trait AwareTrait final public function get(string $key): mixed { - return $this->aware[$key]; + if ($this->has($key)) { + return $this->aware[$key]; + } + throw new NotFoundException; } final public function has(string $key): bool