Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Exception Handling in PHP
Search
Frank Neff
November 06, 2014
Programming
2
130
Exception Handling in PHP
A lightning Talk about exception handling best practices in PHP for one of our customers
Frank Neff
November 06, 2014
Tweet
Share
More Decks by Frank Neff
See All by Frank Neff
Principles of Object Orientation
frne
0
320
Symfony High Availability in the Cloud
frne
0
620
Symfony 3 [german]
frne
0
420
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
350
Plaing with Neo4j -[:USING]-> PHP
frne
0
450
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
160
Package Management Learnings from Homebrew
mikemcquaid
0
160
CSC307 Lecture 05
javiergs
PRO
0
490
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
120
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
0
120
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
270
Python札幌 LT資料
t3tra
7
1.1k
Data-Centric Kaggle
isax1015
2
740
Fragmented Architectures
denyspoltorak
0
140
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
210
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Being A Developer After 40
akosma
91
590k
Prompt Engineering for Job Search
mfonobong
0
150
sira's awesome portfolio website redesign presentation
elsirapls
0
140
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
91
What's in a price? How to price your products and services
michaelherold
247
13k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Google's AI Overviews - The New Search
badams
0
900
Accessibility Awareness
sabderemane
0
45
Transcript
try { Exception Handling in PHP } A brief introduction
Exception != Error
– docs.oracle.com “An exception is an event, which occurs during
the execution of a program, that disrupts the normal flow of the program's instructions.”
– php.net/manual “When an exception is thrown, code following the
statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an "Uncaught Exception ..." message”
Application Layers Presentation Business Data NoDatabaseConnectionException NoResultException EmptyResultException InvalidConfigurationException HTTP/404
HTTP/500
Example EVIL!
– Me “Because a DBAL does not know how to
handle an empty result… But the business logic does!”
Done right
Done right
Pass Exceptions through layers
Exceptions
DBAL
Repository
Controller
– OSS Development Wisdom “An API method should always return
an expected result or throw an exception.”
Thanks ;) frankneff.ch - @frank_neff - github.com/frne