I'm going to develop a Firefox extension which uses some Java classes.
The extension gets the value of <input type="file"> fields, using Javascript.
The Java class I'm going to create is the following:
public class Firefox {
public static String inFileName;
public static void main(String[] args) throws IOException {
in...
so i am using a filter to catch servlet exception (because we are using a mix of jsf/plain servlets)
when catching the ServletException and calling printstacktrace most of the information is lost.
the "true" root exception seems to be hidden behind the "funny" expression
((ServletException) e.getRootCause().getCause()).getRootCause()...
Hello,
I've thrown together a template in Expression Blend for a button, and it works alright - until I tab over to it and press the spacebar. I get the following error:
InvalidOperationException
'[Unknown]' property does not point to a DependencyObject in path '(0).(1).[0].(2)'.
The code is as follows:
<ControlTemplate x:Key="E...
Take this code:
using System;
namespace OddThrow
{
class Program
{
static void Main(string[] args)
{
try
{
throw new Exception("Exception!");
}
finally
{
System.Threading.Thread.Sleep(2500);
Console.Error....
Hello,
I have 2 matrices and I need to multiply them and then print the results of each cell. As soon as one cell is ready I need to print it, but for example I need to print the [0][0] cell before cell [2][0] even if the result of [2][0] is ready first. So I need to print it by order.
So my idea is to make the printer thread wait until...
When you try to access a key which isn't in a Dictionary (for example), here's the stack trace you get :
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
.... .... (my own code stack trace)
Like most people probably do, I log this errors when they occur, ...
In another SO question, I've seen several people recommend me to always use TryGetValue.
While I always use TryGetValue over the Contains?/Access pattern, I avoid this pattern on purpose when I expect the key to always be in the dictionary. I then go for a direct indexer access, so that an exception is raised if the key isn't there, bec...
Disclaimer: I'm completely clueless about .net and COM.
I have a vendor's application that appears to be written in .net and I'm trying to wrap it with a web form (a cgi-bin Perl script) so I can eventually launch this vendor's app from a separate computer. I'm on a Windows Server 2003 R2 SE SP1 system and I'm using Apache 2.2 for the...
When testing with Visual Studio Team Test unhandled exceptions in tests are caught and reported in the results. So I was kind of surprised to see the test hosting process (VSTestHost.exe) crash and showing the system crash dialog.
Upon further investigation this crash was an unhandled exception raised in another thread (more directly, i...
It seems like its not incredibly expensive as long as the stack isn't too deep but I've read conflicting reports. Just wondering if there is a definitive report out there that hasn't been rebutted.
...
I am working with Window Service project. that have to write data to a sheet in Excel file in a sequence times.
But sometimes, just sometimes, the service throw out the exception "Exception from HRESULT: 0x800A03EC" while it's trying to get range with cell's name.
I have put the code of opening excel sheet, and getting cell here.
OS:...
When an exception is thrown or encountered:
void ThrowException()
{
try
{
throw new Exception("Error");
}
catch
{
}
}
is it & how is it disposed from memory?
and how does the above code differ from the below code in respect of the disposal from memory of the Exception object?
void ThrowException()
{
...
I've got a binding list, that under certain hard to reproduce conditions is throwing the following exception when a value is added to it:
System.ArgumentException: Complex DataBinding accepts as a data source either an IList or an IListSource.
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object valu...
Bashing our heads against the wall here
We are an ISV and have hundreds of companies using our software with no problems. The software is Winforms/C# on .NET 2.0.
One of our clients has installed our software and it crashes on startup on all of their machines, apart from on one guy's laptop where it works fine.
On calling OdbcConnecti...
I am wondering how in practice other SOers tend to deal with and/or prevent exceptions.
In what situations do you prevent exceptions, and how?
In what situations do you catch exceptions?
I usually prevent 'NullPointerExceptions' (and other similar ones) by, well, essentially saying if(foo!=null) {...}
I find that in most situations t...
We are using the excellent ELMAH to deal with unhandled exceptions in an ASP.NET 3.5 web application. This works extremely well for all of the site apart from WCF services which are being consumed using the REST features. When an exception occurs within the operation methods that is not handled by the application code, WCF handles it in ...
What is the recommended way of handling the following type of situations:
Supposing I have a model called Cart, that has a 1-1 relationship with the model Person and the same PK (the user's id).
In the index method of my cart_controller I want to check if a Cart exists for the current user.
If I do Cart.find(the_user_id) and a cart does...
Hi there,
If I do not care about a thrown Exception. Can I code in a way as not to create it?
In other words, can an Exception be thrown but no Exception object be created?
An example - Simple example using a System.Net.Sockets.Socket
Socket acceptingSocket;
acceptingSocket.Blocking = false;
while(condition)
{
try
{
...
How do I catch wrong array reference in C++? Why doesn't the following code work:
#include <exception>
int * problemNum = new int;
int (* p [100])() = {problem1, problem2, problem3};
...
try {
cout << (*p[*problemNum-1])();
}
catch (exception){
cout << "No such problem";
}
My compiler...
I am getting the object reference error in just start of the method.
For Ex.:
259: public ActionResult ShowAddress(FormCollection formCollection)
260: {
In the above sample i am getting the error Line number 260.
Please anyone can suggest me the problem with this.
...