I created a new class which inherits from the HandleErrorAttribute to handle ajax requests differently. The only override is on the OnException method:
public override void OnException(ExceptionContext filterContext)
{
if (filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
{
filterContext.ExceptionHandled = true...
Hello all,
I have two questions, one is wordy and one programmy!
1) I know that PHP reporting on notices causes performnace problems (takes time to report on these errors and figure out what sort of error it is) but is this the same case if error_reporting is turned off? I guess it still does slow down performance but not as much as di...
I have a PHP site which (as every other site) has some hidden errors. The question is what should happen when an error occurs?
I see lots of PHP and other sites where in case of an error the page is a bit broken, sometimes even an internal error message is dumped to the page, but usually the site stays partly usable.
The other approach...
I am currently refactoring some code for work and I have come across some function calls prefixed by the "@" symbol. As I understand it, this is intended to escape PHP error reporting if the call fails.
Is this type of thing good practice? I understand the rationale in a development environment but when the site is pushed to production...
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/catch my data operations. If there is an excepti...
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 really the best approach.
As far as my o...
Hi guys,
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 is been thrown by the System.Exce...
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 (say, for example, int num = 42)?
...
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 instead of crashing my application?
Edit:
...
I've been trying to get this working, but for some reason it's giving me errors...
How can I log my python errors?
try:
pass #CODE HERE
except:
pass #LOG TRACEBACK ERROR ...whatever that error may be
...
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 click:
anchor.click();
...where anchor has the type: ...
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 out exactly which reference is throwing the...
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.
Also note that I do not use try catch or any...
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 like to know what the best (as in most strai...
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't really care about the annotation. It won...
Now I'm developing UIWebView based iPhone app.
It is important to be sure that all requests are executing properly.
To handle possible errors I'n using webView:didFailLoadWithError: message from UIWebViewDelegate protocol.
Where I can find the list of the error codes this control may return?
...
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.
...
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.
We have a single, specific, Images folder,...
Hello,
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 there is only an error with the firs...
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.
...