The online racing simulator
Exception sent to function in C#?
Is a code like the following possible?

try {
string tempstring = "cookie";
int tempint = int.Parse(tempstring);
} catch (Exception EXC) {
otherClass.makeErrorFile(EXC);
}

And the makeErrorFile void to have a stream writer that writes EXC.Message and EXC.StackTrace to an error file.
It manages to create the file, but it doesn't manage to write to it. I am sure that I have no mistakes in the code to write the file. But I think that the way I send this exception might be wrong.

Thanks for any answers in advance. I'll keep on trying now till I get it right.

Seems like my lucky day today. I got it to work. Just to let you know if you are curious - You can send Exceptions to other functions.
I'm no C# guy, but following code seemed to be working for me


static void Main(string[] args)
{
DumpException dexp = new DumpException();
try
{
string tempstring = "cookie";
int tempint = int.Parse(tempstring);
}
catch (Exception ex)
{
dexp.dumpEx(ex);
}
}


class DumpException
{
public void dumpEx(Exception ex) {
String exceptionTrace = ex.ToString();

FileInfo f = new FileInfo("Dump.txt");
StreamWriter Tex = f.CreateText();
Tex.WriteLine(exceptionTrace);
Tex.Write(Tex.NewLine);
Tex.Flush();
Tex.Close();

}
}


FGED GREDG RDFGDR GSFDG