When using Marshal.GetExceptionCode() how do you get the Exception Type and/or instance of the exception?
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getexceptioncode%28VS.71%29.aspx
...
So we are a few guys developing this product that is communicating with a really unstable server. It often returns very strange and corrupt data. During testing we want the resulting crashes to be loud, so we discover them. But every other day we need to demonstrate our product for a potential customer. To the customer the errors will go...
Hi,
I have an application that sometimes causes an access violation on exit. This is quite unpredictable and all attempts to locate the bug have been unsuccesful so far. The bug is harmless, as no data is lost, so I was thinking if it might be possible to just hide it.
Is it possible to have another app launch the buggy one and catch t...
I want to rethrow same exception in sql server that has been occured in my try block.
I am able to throw same message but i want to throw same error.
BEGIN TRANSACTION
BEGIN TRY
INSERT INTO Tags.tblDomain
(DomainName, SubDomainId, DomainCode, Description)
VALUES(@DomainName, @SubDomainId, @Domai...
I am trying to implement an OutOfStockException for when the user attempts to buy more items than there are available. I'm not sure if my implementation is correct. Does this look OK to you?
public class OutOfStockException extends Exception {
public OutOfStockException(){
super();
}
public OutOfStockException(St...
Hi,
We have a sharepoint 2007 project at work. The exception handling policy is to log to the Sharepoint logs.
In this case, would the best approach be to call that method and then rethrow the exception higher up? Except if I rethrow it to be caught higher up, there is no other exception handling code so what would happen in this case?...
Hi,
Could someone please help me to solve unhandled exception error when using visual C++ 2008? the error is displayed as follow: Unhandled exception at 0x00411690 in time.exe: 0xC0000005: Access violation reading location 0x00000008
Some details:
- tm 0x00000000 {tm_sec=??? tm_min=??? tm_hour=??? ...} tm *
tm_sec CXX0...
Hi,
In a team environment, if I handle an exception (like so):
protected void Page_Load(object sender, EventArgs e)
{
this.exTest();
}
public void exTest()
{
try
{
throw new Exception("sjsj");
}
catch (Exception ex)
{
string s = ex.Message;
throw;
}
}
What is the implicatio...
Hi
I am getting this error : "Unhandled exception at 0x00411690 in tim.exe: 0xC0000005: Access violation reading location 0x00000008" when I execute a program this is compiled and linked successfully and the problem is that localtime() function is not correctly recognized by Visual C++ 2008. (With VC++6, this program works fine).
...
...
Hi!
I have this code
try
{
//AN EXCEPTION IS GENERATED HERE!!!
}
catch
{
SqlService.RollbackTransaction();
throw;
}
Code above is called in this code
try
{
//HERE IS CALLED THE METHOD THAT CONTAINS THE CODE ABOVE
}
catch (Exception ex)
{
HandleException(ex);
}
The exception passed as parameter to the method "HandleE...
Could someone provide some example on implementing SEH in VB6? Everything I've seen so far is in C++
...
I want to log some seemingly random errors I'm getting in a Delphi written COM DLL. How do I do this? Is it possible to use the Application.OnException event handler? I have control of the COM DLL source, but not the calling application.
...
For many methods in .NET, the exceptions they can potentially throw can be as many as 7-8 (one or two methods in XmlDocument, Load() being one I think, can throw this many exceptions).
Does this mean I have to write 8 catch blocks to catch all of these exceptions (it is best practise to catch an exception with a specific exception block...
I have the following 3 lines of the code:
ServerSocket listeningSocket = new ServerSocket(earPort);
Socket serverSideSocket = listeningSocket.accept();
BufferedReader in = new BufferedReader(new InputStreamReader(serverSideSocket.getInputStream()));
The compiler complains about all of these 3 lines and its complain is the same for all...
Hi
I have a VC++ application and in my application i have some basic file operations.
Below is the defaulting code
CStdioFile cFile;
CFileException e;
CString sReport;
CString sHtmlfile = "testreport.html"
OutputDebugString((sHtmlfile));
if (!cFile.Open(sHtmlfile,CFile::modeCreate | CFile::modeWrite, &e ))
{
}
The problem is my app...
What exactly does a finally block in exception handling perform?
...
Is there some sort of exception in Java to catch an invalid Date object? I'm trying to use it in the following method, but I don't know what type of exception to look for. Is it a ParseException.
public boolean setDate(Date date) {
this.date = date;
return true;
}
...
what is this exception and how to remove this
in my problem i am creating an arraylist of objects, and after checking some condition,i want to remove some objects. but the program is giving this exception ConcurrentModificationException. how to remove this
thanks in advance
...
First off I run my applications with exceptions thrown on any error (handled or not).
Second I am using a TypeConverter to convert from a user input string to the actual object.
Third TypeConverter offers no TryConvert method so I'm stuck using exceptions for validation, using this rather ugly bit of code here:
try
{
this._newVal...
//
// To Throw
void PrintType(object obj)
{
if(obj == null)
{
throw new ArgumentNullException("obj")
}
Console.WriteLine(obj.GetType().Name);
}
//
// Not to Throw
void PrintType(object obj)
{
if(obj != null)
{
Console.WriteLine(obj.GetType().Name);
}
}
What principle to keep?
Personal...