2
голосов
3ответов
1044 просмотров

PHP error_log performance issues

I've been trying to write an error handling class that I can use on sites, that will email me in the event of an error. Problem is, when I profile the application, it's choking on the error_log function. Here's my code (omitting the class: class ErrorHandler { private static $instance; private s...

1
голосов
1ответов
1455 просмотров

How to use the [HandleError] attribute in ASP.NET MVC?

I've got some custom error handling in my ASP.NET MVC site -> seems to be working fine. I have an Error Controller, like this :- /Controller/ErrorController.cs [AcceptVerbs(HttpVerbs.Get)] public ActionResult Unknown() { Response.StatusCode = (int)HttpStatusCode.InternalServerError; ...

0
голосов
3ответов
1133 просмотров

DLL not found error

I have a situation where I am using a third party library. On machines where the library is not installed, I am getting the excption: Unable to load DLL '*.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E). However, I am wrapping the calling code in a try-catch b...

0
голосов
1ответов
1428 просмотров

PHP Error output - Plesk 9.2 with IIS7 and FastCGI

Where can I view PHP errors that are generated by a Plesk 9.2 website? I currently get a generic 500 error when I create a test PHP error: 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. I have, unsuccessfully, tried to activa...

1
голосов
2ответов
124 просмотров

Best practices to deal with absent/wrongly typed GET variables?

What do you do when you detect your get request is broken or is passing wrong types of data? Say you have a forum-page.php?forum=3 that lists all the topics related to forum 3. What would be a good way to deal with the absence of the "forum" variable? What about if instead of being an integer, y...

3
голосов
4ответов
3167 просмотров

Why does writing to an unconnected socket send SIGPIPE first?

There are so many possible errors in the POSIX environment. Why do some of them (like writing to an unconnected socket in particular) get special treatment in the form of signals?

0
голосов
1ответов
1177 просмотров

Zend Framework ErrorController not working on live site?

My site is set up pretty much as per the Zend Quickstart guide. The default ErrorController works locally using MAMP. But now I've deployed it to my live site I get a blank page and a "500 Internal Server Error" according to FireBug when I go to an action that doesnt exist. On my local server I...

6
голосов
5ответов
1455 просмотров

Best Practices for Live Website Error Management

I am just about to launch a fairly large website for the first time. I have turned off all error messages in my php.ini and error messages are now logged to an "error_log" file on my server. My question is, now that the errors are logged to a file, what are the best ways that web developers kee...

1
голосов
3ответов
1553 просмотров

Overwriting the errorPage property in JSP

I've defined <%@ page errorPage="/error.jsp" %> in the header that all JSP files include, to catch any unhandled exceptions and redirect to that error page instead of printing them. This works fine with one caveat - if error.jsp itself throws an exception, it will continuously redirect to i...

1
голосов
2ответов
1098 просмотров

Custom error handling ASP.NET

I want to use custom exception handling, for example instead of using (Exception ex) i want to use (LoginException ex) or (RegistrationException ex) or (SomeNameException ex) is it possible to design such custom exception handling in ASP.NET webforms?

1
голосов
2ответов
661 просмотров

How do I accurately report errors when using PowerShell's Measure-Command

When I have an error inside a script block that I'm testing with Measure-Command, the error is show at the line of the invocation, and not at the location the error is thrown. Here's an example: function ThrowAnError { Write-Host "in ThrowAnError" throw "ThrowAnError" } Measure-Command...

5
голосов
2ответов
906 просмотров

Throwing errors in Javascript with error object relevancy

This is pretty much IE related because IE is the environment I'm using to test this, but I want to know if you can affect the relevancy of the error object properties when you throw an error. Consider the following javascript: function MyClass (Arg1, Arg2) // Line 5 of my.js { if (typeof...

1
голосов
2ответов
2031 просмотров

WCF Error Logging

I am working on a project that is using NetTcp bindings for talking to some WCF services. When first starting out we took a bad practice example from another application that made WCF calls by using the following: EntityObject sample = new ServiceProxy().GetEntity(); That worked great until we...

0
голосов
2ответов
149 просмотров

Is there any good defacto standard 'everything went smoothly' message in a method that returns string errors?

So my class takes data and does it's thing, returning an error message if anything went wrong. What should I make the string if everything went fine? null? "1"? "OK!"? "success"? Please support your answer.

56
голосов
10ответов
60091 просмотров

How can I get php to return 500 upon encountering a fatal exception?

PHP fatal errors come back as status code 200 to the HTTP client. How can I make it return a status code 500 (Internal server error)?

0
голосов
1ответов
818 просмотров

Php foreach loop, with looping error messages

I have a foreach loop that is suppose to check to see if a checkbox is checked by an item. If the checkbox is checked I need to see if the file upload part of the script has a value and if so then proceed to check the file type and size of the file the user is trying to upload. Currently if the...

97
голосов
4ответов
36056 просмотров

Catching error codes in a shell pipe

I currently have a script that does something like ./a | ./b | ./c I want to modify it so that if any of a, b or c exit with an error code I print an error message and stop instead of piping bad output forward. What would be the simplest/cleanest way to do so?

0
голосов
1ответов
528 просмотров

What technical features could I include in my 404 File Not Found error handling page?

I have a custom 404 error handling page It looks up the URL in a database table and redirects if there is a suitable target. URLs are logged, together with the Redirect provided (if any) and our App has an Admin report to show which URLs are getting caught, allowing Client to set up more etc. ...

3
голосов
1ответов
194 просмотров

PHP Exceptions rather than errors

Is there a way in PHP to make sure that I get Exceptions for everything rather than errors? Using two different methods of errorhandling leaves me uncomfortable and it feels messy. I'd prefer the Exception style method as its more OO and thus fits better with my other programming experience.

23
голосов
1ответов
11792 просмотров

How do I turn off error validation for annotations in Intellij IDEA?

I have a developer counterpart who uses Eclipse, which inserts annotations in various positions automatically in our JUnit tests. However, when I open the test in IDEA, the annotation is underlined red, and the annotation reads "@Override is not allowed when implementing interface method". I don'...

14
голосов
5ответов
11449 просмотров

Reducing information disclosure in Tomcat error pages

By default, Tomcat's error pages disclose both the existence of Tomcat and the exact version of the container that's handling the requests. This is nice for development, but in a production context this information is a potential security hole and it would be nice to disable it. Thus I would li...

3
голосов
3ответов
571 просмотров

How do I separate error handling from business logic in Perl?

How do I separate out exception handling / error handling from business logic? I'm writing code in Perl, and the error/exception handling and business logic makes it very difficult to understand code while reviewing. How can I refactor my code to make it more readable yet have error handling. Al...

3
голосов
3ответов
5864 просмотров

AS3 -TypeError #1009 - any easy way to find out *which* object reference is null?

We all get "TypeError #1009 Cannot access a property or method of a null object reference" now and then - no big deal, but sometimes frustrating to debug. Flash gives you the call stack (which is a start), but leaves it up to you to figure out where the null object is - is it possible to find o...

0
голосов
3ответов
3011 просмотров

How can I disable JavaScript warnings in the WebBrowser control?

I'm using the WebBrowser control and mshtml.dll. When I simulate click on link <a href='..'>..</a>, the WebBrowser shows a JavaScript warning dialog: Unable to move the focus to the element as it is in the invisible ,off or can't have a focus. The code I use to simulate the cli...

154
голосов
10ответов
127014 просмотров

Log exception with traceback

How can I log my Python errors? try: do_something() except: # How can I log my exception here, complete with its traceback?

10
голосов
6ответов
32144 просмотров

sprintf_s with a buffer too small

The following code causes an error and kills my application. It makes sense as the buffer is only 10 bytes long and the text is 22 bytes long (buffer overflow). char buffer[10]; int length = sprintf_s( buffer, 10, "1234567890.1234567890." ); How do I catch this error so I can report it i...

0
голосов
3ответов
215 просмотров

Why check only certain values for errors? (C++?)

I recently started learning DirectX/Windows, and the book I'm learning from had the code d3d = Direct3DCreate9(D3D_SDK_VERSION); if(d3d == NULL) //catch error &c. My question is: What would cause an error in this line, that is different than what would cause an error in another line (s...

2
голосов
1ответов
680 просмотров

What can cause Application_Error not to be invoked?

For the last 2 weeks I have a case that I can't figure it out, maybe you guys already passed through the same problem or ear/read about it and can help me. I have an ASP.NET Project that I run on my machine and other machines fine, every time I try to temper the QueryString I get an error that i...

10
голосов
4ответов
2843 просмотров

Should a Perl constructor return an undef or a "invalid" object?

Question: What is considered to be "Best practice" - and why - of handling errors in a constructor?. "Best Practice" can be a quote from Schwartz, or 50% of CPAN modules use it, etc...; but I'm happy with well reasoned opinion from anyone even if it explains why the common best practice is not...

6
голосов
3ответов
837 просмотров

How to properly handle errors in an n-tier application?

I have struggled with this since day 1. It probably doesn't help that I've been surrounded by a lot of code that doesn't even handle errors at all. Anyway, I'm working with WebForms in your traditional n-tier design: UI->BLL->DAL. Usually what I do (and I know it's not right) is to try/c...