Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 58691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:53:15+00:00 2026-05-10T17:53:15+00:00

I’m familiar with some of the basics, but what I would like to know

  • 0

I’m familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases where it shouldn’t be used? Also, what are some of the common security concerns in regard to error handling?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:53:16+00:00Added an answer on May 10, 2026 at 5:53 pm

    One thing to add to what was said already is that it’s paramount that you record any errors in your web application into a log. This way, as Jeff ‘Coding Horror’ Atwood suggests, you’ll know when your users are experiencing trouble with your app (instead of ‘asking them what’s wrong’).

    To do this, I recommend the following type of infrastructure:

    • Create a ‘crash’ table in your database and a set of wrapper classes for reporting errors. I’d recommend setting categories for the crashes (‘blocking’, ‘security’, ‘PHP error/warning’ (vs exception), etc).
    • In all of your error handling code, make sure to record the error. Doing this consistently depends on how well you built the API (above step) – it should be trivial to record crashes if done right.

    Extra credit: sometimes, your crashes will be database-level crashes: i.e. DB server down, etc. If that’s the case, your error logging infrastructure (above) will fail (you can’t log the crash to the DB because the log tries to write to the DB). In that case, I would write failover logic in your Crash wrapper class to either

    • send an email to the admin, AND/OR
    • record the details of the crash to a plain text file

    All of this sounds like an overkill, but believe me, this makes a difference in whether your application is accepted as a ‘stable’ or ‘flaky’. That difference comes from the fact that all apps start as flaky/crashing all the time, but those developers that know about all issues with their app have a chance to actually fix it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In C, you must compile your program with the TINY… May 11, 2026 at 2:23 pm
  • added an answer File.Encrypt is pretty simple - one call (with one parameter).… May 11, 2026 at 2:23 pm
  • added an answer Use the adodb.command object. with createobject('adodb.command') .activeConnection = application('connectionstring') .commandText… May 11, 2026 at 2:23 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.