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.![](/static/smilies/smile.gif)
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.
![](/static/smilies/smile.gif)