error-reporting
How to display errors on laravel 4?
@Matanya – have you looked at your server logs to see WHAT the error 500 actually is? It could be any number of things @Aladin – white screen of death (WSOD) can be diagnosed in three ways with Laravel 4. Option 1: Go to your Laravel logs (app/storage/logs) and see if the error is contained … Read more
Application_Error in global.asax not catching errors in WebAPI
Abstract out your error handling logic from Application_Error into its own function. Create a Web API exception filter. //register your filter with Web API pipeline //this belongs in the Application_Start event in Global Application Handler class (global.asax) //or some other location that runs on startup GlobalConfiguration.Configuration.Filters.Add(new LogExceptionFilterAttribute()); //Create filter public class LogExceptionFilterAttribute : ExceptionFilterAttribute { … Read more
PHP not displaying errors even though display_errors = On
You also need to make sure you have your php.ini file include the following set or errors will go only to the log that is set by default or specified in the virtual host’s configuration. display_errors = On The php.ini file is where base settings for all PHP on your server, however these can easily … Read more
Error logging in C#
Lots of log4net advocates here so I’m sure this will be ignored, but I’ll add my own preference: System.Diagnostics.Trace This includes listeners that listen for your Trace() methods, and then write to a log file/output window/event log, ones in the framework that are included are DefaultTraceListener, TextWriterTraceListener and the EventLogTraceListener. It allows you to specify … Read more
How to avoid isset() and empty()
For those interested, I have expanded this topic into a small article, which provides the below information in a somewhat better structured form: The Definitive Guide To PHP’s isset And empty IMHO you should think about not just making the app “E_NOTICE compatible”, but restructuring the whole thing. Having hundreds of points in your code … Read more
Why is exception handling bad? [closed]
Exceptions make it really easy to write code where an exception being thrown will break invariants and leave objects in an inconsistent state. They essentially force you to remember that most every statement you make can potentially throw, and handle that correctly. Doing so can be tricky and counter-intuitive. Consider something like this as a … Read more
What to do with mysqli problems? Errors like mysqli_fetch_array(): Argument #1 must be of type mysqli_result and such
TL;DR Always have mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); in your mysqli connection code and always check the PHP errors. Always replace every PHP variable in the SQL query with a question mark, and execute the query using prepared statement. It will help to avoid syntax errors of all sorts. Explanation Sometimes your MySQLi code produces an error … Read more
How to get users to read error messages? [closed]
That is an excellent question worthy of a +1 from me. The question despite being simple, covers many aspects of the nature of end-users. It boils down to a number of factors here which would benefit you and the software itself, and of course for the end-users. Do not place error messages in the status … Read more