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 7805137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:07:34+00:00 2026-06-02T02:07:34+00:00

A normal thrown and uncaught exception in PHP will produce output similar to this:

  • 0

A normal thrown and uncaught exception in PHP will produce output similar to this:

Fatal error: Uncaught exception 'Exception' with message 'Insufficient permissions or something' in /home/codemonkey/foo/bar/File.php:143
Stack trace:
#0 /home/codemonkey/dev/foo/bar/SomeOtherFile.php(85): foo\bar\File::fromUpload(Array)
#1 /home/codemonkey/dev/foo/bar/OmniDataFileImport.php(35): foo\bar\OmniDataFileImport->performFileImportLogic()
#2 [internal function]: foo\bar\OmniDataFileImport->post(Object(Request), false)
#3 /home/codemonkey/dev/foo/vendor/tonic/lib/tonic.php(654): call_user_func_array(Array, Array)
#4 /home/codemonkey/dev/foo/dispatch.php(22): Resource->exec(Object(Request))
#5 {main}
  thrown in /home/codemonkey/dev/foo/broadnet/files/File.php on line 143

The message and stack trace is cool, but I would really like more information. For that reason I want to extend the Exception with more information such as local variables and their values. The problem is that PHP will probably still output the same above information but with the text “Uncaught exception ‘MyException'” instead.

Can I override the way PHP displays uncaught exceptions? I recall reading about a function in PHP that you can set as a backup to catch all uncaught exceptions. Perhaps I can use that functionality to format my own message and kill the process.

Thanks for all helpful information on the topic

  • 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. Editorial Team
    Editorial Team
    2026-06-02T02:07:36+00:00Added an answer on June 2, 2026 at 2:07 am

    You are looking for set_exception_handler().

    However, you cannot retrieve local variables etc. – PHP’s error handling/debugging is rather poor unless you use a debugging extension which is not suitable for a production system.

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

Sidebar

Related Questions

Whenever an exception is thrown from my normal controller action methods elmah correctly redirects
Fatal error : Uncaught CurlException: 60: Peer certificate cannot be authenticated with known CA
A normal UserControl looks like this in XAML: <UserControl x:Class=mynamespace.foo ...namespaces...> <!-- content -->
My web service method returns a collection object, this will serialize nicely, thanks to
The following code demonstrates a case where a checked exception, ExecutionException , is thrown
I am chasing an exception which is thrown from a part of code which
When I run an application into eclipse, if an exception is thrown and is
I get the following error message when compiling: 2011-11-27 14:59:32.049 Storyboard[12104:f803] -[TargetViewController setPeople:]:unrecognized selector
When a normal exception occurs, a stack trace like the following is outputted: util.js:38
Normal Display (Xcode 4.2 4D199, Mac OS X Lion): Abnormal Display (Xcode 4.2 4C199,

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.