Put a try...catch block around teh code which is accessing it, and examine the exception in the catch block. There is no specific part of an exception that is the error number: you will have to work from the exception type and message.
try
{
}
catch (Exception ex)
{
}