Skip to content

Commit 49425b8

Browse files
committed
Merge branch 'release/0.9.11'
2 parents 3d61c35 + 72bdea3 commit 49425b8

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 9,
5-
"patch": 10,
5+
"patch": 11,
66
"build": 0
77
}

src/Mvc/Application.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ protected function onRun() : void
262262
* @param string $requestName
263263
* @return mixed
264264
* @throws MissingMethod
265-
* @throws NotFound
266265
* @throws Exception
267266
*/
268267
public function executeController( array $parameters, string $requestName = '' ): mixed
@@ -299,7 +298,26 @@ public function executeController( array $parameters, string $requestName = '' )
299298

300299
$request->setRouteParameters( $parameters );
301300

302-
return $controller->$method( $request );
301+
// Catch NotFound exceptions and redirect to 404
302+
try
303+
{
304+
return $controller->$method( $request );
305+
}
306+
catch( NotFound $e )
307+
{
308+
Log::warning( "Resource not found: " . $e->getMessage() );
309+
310+
Event::emit( new Http404( $parameters['route'] ?? 'unknown' ) );
311+
312+
return $this->executeController(
313+
array_merge(
314+
$parameters,
315+
[
316+
"Controller" => "Neuron\Mvc\Controllers\HttpCodes@code404",
317+
]
318+
)
319+
);
320+
}
303321
}
304322

305323
/**

versionlog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.9.11 2025-11-27
2+
13
## 0.9.10 2025-11-27
24
* Updated markdown to respect file paths.
35

0 commit comments

Comments
 (0)