Exceptions

D

Daniel Imesch

Hi,
In the following I have an error message in the exception managment.
The throw returns an error message that the excepton is not managed, I don't
know why?
Can you help me?
Thanks in advance
Daniel

------------------------------------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace MyLib
{
public class FileManipException : Exception
{
public FileManipException() {}
public FileManipException(string message) : base(message) {}
public FileManipException(string message, Exception inner) :
base(message, inner) {}
}

public class FileManip
{
public FileManip() { }

public void FileCopy(string source, string destination)
{
try
{
File.Copy(source, destination);
}
catch (Exception e)
{
throw new FileManipException("Error on copy : " +
e.Message.ToString());
}
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top