Questions tagged [error-handling]
Programming language constructs designed to handle errors signaled by error codes, exceptions or other language specific means.
error-handling
2,649
questions
1286
votes
39
answers
281k
views
Reference - What does this error mean in PHP?
What is this?
This is a number of answers about warnings, errors, and notices you might encounter while programming PHP and have no clue how to fix them. This is also a Community Wiki, so everyone is ...
55
votes
6
answers
91k
views
I'm getting an IndentationError (or a TabError). How do I fix it?
I have a Python script:
if True:
if False:
print('foo')
print('bar')
However, when I attempt to run my script, Python raises an IndentationError:
File "script.py", line 4
...
2017
votes
27
answers
3.6m
views
How do I get PHP errors to display?
I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have restarted my Apache webserver.
I have even put these lines at the top of my script, and it ...
651
votes
41
answers
715k
views
How can I get useful error messages in PHP?
Quite often I will try and run a PHP script and just get a blank screen back. No error message; just an empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon),...
505
votes
20
answers
650k
views
What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean?
My Swift program is crashing with EXC_BAD_INSTRUCTION and one of the following similar errors. What does this error mean, and how do I fix it?
Fatal error: Unexpectedly found nil while unwrapping ...
220
votes
11
answers
608k
views
Error: could not find function ... in R
This is meant to be a FAQ question, so please be as complete as possible. The answer is a community answer, so feel free to edit if you think something is missing.
This question was discussed and ...
129
votes
0
answers
143k
views
PHP's white screen of death [duplicate]
Now that I'm starting to get back into PHP, I'm starting to remember why I gave it up in the first place. The most annoying thing on my plate at the moment is what I've come to term "PHP's white ...
25
votes
1
answer
9k
views
Should we ever check for mysqli_connect() errors manually?
The PHP manual for mysqli_connect() suggests checking for the return value and displaying the error messages on the screen.
$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
if (...
478
votes
30
answers
1.3m
views
Where does PHP store the error log? (PHP 5, Apache, FastCGI, and cPanel)
I am on shared hosting and have cPanel, Apache, and PHP is run by FastCGI. Where does PHP store the error log?
Is there another way I can find the error log on a shared hosting environment instead of ...
62
votes
0
answers
127k
views
How do I enable error reporting in PHP? [duplicate]
I recently moved my site from a shared server to my own server. Now, when I have a PHP error, I get a 500 Internal Server Error. At my old host, I'd get something like "Fatal error: Expecting ;". How ...
61
votes
4
answers
33k
views
How to squeeze error message out of PDO? [duplicate]
I can't seem to get any error message from PDO:
#$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
try {
$sth = $dbh->prepare('@$%T$!!!');
print_r($sth);
print_r($dbh->...
2703
votes
52
answers
621k
views
Does a finally block always get executed in Java?
Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is?
try {
something();
return success;
}
catch (Exception e) {
...
421
votes
19
answers
350k
views
Why is "except: pass" a bad programming practice?
I often see comments on other Stack Overflow questions about how the use of except: pass is discouraged. Why is this bad? Sometimes I just don't care what the errors are and I want to just continue ...
230
votes
24
answers
668k
views
Deploying website: 500 - Internal server error
I am trying to deploy an ASP.NET application. I have deployed the site to IIS, but when visiting it with the browser, it shows me this:
Server Error
500 - Internal server error.
There is a problem ...
425
votes
14
answers
275k
views
Can I try/catch a warning?
I need to catch some warnings being thrown from some php native functions and then handle them.
Specifically:
array dns_get_record ( string $hostname [, int $type= DNS_ANY [, array &$authns [...