Skip to content

Fix Model::__get() swallowing \Throwable - #309

Merged
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:techmahedy-4.x
Sep 10, 2026
Merged

Fix Model::__get() swallowing \Throwable#309
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:techmahedy-4.x

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Removed the broad try { ... } catch (\Throwable) { return; } wrapper around the entire method body.

The previous implementation was silently swallowing all exceptions, including genuine application errors from cast resolution, relation queries, computed properties, and other property-resolution logic.

It was also masking dead code: the explicit throw new \Exception("Property or relation '$name' does not exist...") could never reach the caller because it was immediately caught by the enclosing catch. The "not found" case has therefore been simplified to a direct return null;, while all other exceptions are now allowed to propagate normally.

@techmahedy
techmahedy merged commit 726cb69 into doppar:4.x Sep 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant