error-reporting

C++/Windows: How to report an out-of-memory exception (bad_alloc)?

时间秒杀一切 提交于 2019-12-23 07:56:27
问题 I'm currently working on an exception-based error reporting system for Windows MSVC++ (9.0) apps (i.e. exception structures & types / inheritance, call stack, error reporting & logging and so on). My question now is: how to correctly report & log an out-of-memory error? When this error occurs, e.g. as an bad_alloc thrown by the new op, there may be many "features" unavailable, mostly concerning further memory allocation. Normally, I'd pass the exception to the application if it has been

How can I programmatically launch visual studio and send it to a specific file / line?

狂风中的少年 提交于 2019-12-23 02:38:31
问题 I have a nice tidy way of capturing unhandled exceptions which I display to my users and (optionally) get emailed to myself. They generally look something like this: Uncaught exception encountered in MyApp (Version 1.1.0)! Exception: Object reference not set to an instance of an object. Exception type: System.NullReferenceException Source: MyApp Stack trace: at SomeLibrary.DoMoreStuff() in c:\projects\myapp\somelibrary.h:line 509 at SomeAlgothim.DoStuff() in c:\projects\myapp\somealgorithm.h

How to change the way PHP writes errors in the error log file?

允我心安 提交于 2019-12-22 09:18:30
问题 I have been working on my website for over a year now, and I am very anxious to finally put it out there for people to use. It has gotten quite large however - I almost want to say out of my control - and on top of that I am really just an self taught amateur programmer. So I want to be sure, that any errors that php produces are logged in a file, so I can than access this file and track errors down. Currently my settings are the following: <?php error_reporting(E_ALL); ini_set('display

Php not reporting any errors on IIS7

空扰寡人 提交于 2019-12-21 18:57:10
问题 I am developing a PHP application using our XAMPP setup as a test server. Once the app is ready to deploy, I have to upload it to the client's server, The problem is the client's server is running IIS 7, and every time there is a PHP error it just displays a blank page... Now, my app has error_reporting(E_ALL) already set, and I do not have access to the php.ini file (don't ask why!)... and I have tried every combination of parameters for error_reporting() found here: http://www.php.net

YUI CustomEvent no errors being reported

橙三吉。 提交于 2019-12-21 06:58:01
问题 Does anyone know how to get the below to report a javascript error? (any browser) <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"> </script> <script type="text/javascript"> ObjWithEvent = { testEvent: new YAHOO.util.CustomEvent("testEvent") }; ObjSubscriber = { handleTestEvent: function(){ alert('the next line will not show up in the error console'); not_a_valid_function_bro(); } };

PHP FPM returns HTTP 500 for all PHP errors

家住魔仙堡 提交于 2019-12-21 06:57:13
问题 I am running nginx with PHP-FPM. My nginx configuration for handling php files looks like this: location ~ \.php$ { set $php_root /home/me/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } Now, I have a simple php file like this: <?php ech "asd" asd"" ?> Yes, with an obvious error. When I try accessing the php file, instead of tracing a syntax error, I always get a HTTP 500 Internal

Does PHP error_reporting(0) affect error logging, or just display?

走远了吗. 提交于 2019-12-18 15:01:12
问题 Does error_reporting(0); have any effect on error logging (to file), or does it just suppress on-screen error display? Thanks. 回答1: Yes, it affects both. The error_reporting level defines what levels of errors gets triggered . Whether you log or display those errors are determined by the other settings. To summarize: error_reporting: What levels of errors get triggered. display_errors: Whether to show triggered errors in script output. log_errors: Whether to write triggered errors to a log.

PHP warning: headers already sent in Unknown [duplicate]

北城余情 提交于 2019-12-17 21:03:46
问题 This question already has answers here : How to fix “Headers already sent” error in PHP (11 answers) Closed 6 years ago . I'm looking for things that might trigger the following PHP warning: PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 回答1: Turned out that it was the line ob_start("ob_gzhandler"); that caused the warning. This has been reported and fixed in 2001, it seems, but for some reason it keeps coming back. 回答2: It might be a lot of things,

PHP 5.4: disable warning “Creating default object from empty value”

感情迁移 提交于 2019-12-17 19:20:02
问题 I want to migrate code from PHP 5.2 to 5.4. This worked fine so far except that all the code I use makes extensive use of just using an object with a member without any initialisation, like: $MyObject->MyMember = "Hello"; which results in the warning: "Creating default object from empty value" I know that the solution would be to use: $MyObject = new stdClass(); $MyObject->MyMember = "Hello"; but it would be A LOT OF WORK to change this in all my code, because I use this many times in

How can I stop PHP notices from appearing in wordpress?

廉价感情. 提交于 2019-12-17 17:55:31
问题 I know about error_reporting(0); , and ini_set('display_errors', false); , but there is a notice appearing in wordpress: Notice: Array to string conversion in /var/www/vhosts/treethink.net/subdomains/parkridge/httpdocs/wp-includes/formatting.php on line 359 it only appears in wordpress, not in any other pages of the site. I checked phpinfo() , and everything is set so that errors are not displayed. Why does this one still show up? Here is the line that generates the error: function wp_check