Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Figueiredo Jr. <fxjr@mono-cvs.ximian.com>2004-05-10 02:28:00 +0400
committerFrancisco Figueiredo Jr. <fxjr@mono-cvs.ximian.com>2004-05-10 02:28:00 +0400
commitaaee641fbba3ac0e24e4d9b1485e680f0ecb2727 (patch)
tree652a2e4bf81aa5480acbd1b8acb05b16f19bb21b /mcs/class/Npgsql/NpgsqlTypes
parentf99302f41aca58ab66552db5d7f73557ba1a9a1e (diff)
2004-05-09 Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
* HashAlgorithm.cs, NpgsqlAsciiRow.cs, NpgsqlBinaryRow.cs, NpgsqlClosedState.cs, NpgsqlCommand.cs, NpgsqlCommandBuilder.cs, NpgsqlConnection.cs, NpgsqlDataReader.cs, NpgsqlException.cs, NpgsqlParameterCollection.cs, NpgsqlReadyState.cs, NpgsqlTransaction.cs: Improved exception handling. Now Npgsql throws mor e meaningful exceptions instead of throw NpgsqlException which are now exclusive ly to sign server errors. Thanks Glen Parker (glenebob@nwlink.com) for the patch. svn path=/trunk/mcs/; revision=27009
Diffstat (limited to 'mcs/class/Npgsql/NpgsqlTypes')
-rwxr-xr-xmcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/mcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs b/mcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs
index 7d4d21f9ad2..00ad0705d57 100755
--- a/mcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs
+++ b/mcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs
@@ -144,7 +144,7 @@ namespace NpgsqlTypes
case DbType.Time:
return "time";
default:
- throw new Exception(String.Format(resman.GetString("Exception_TypeNotSupported"), dbType));
+ throw new InvalidCastException(String.Format(resman.GetString("Exception_TypeNotSupported"), dbType));
}
}
@@ -179,7 +179,7 @@ namespace NpgsqlTypes
case DbType.StringFixedLength:
return encoding.GetString(data, 0, fieldValueSize);
default:
- throw new Exception("Type not supported in binary format");
+ throw new InvalidCastException("Type not supported in binary format");
}
@@ -229,7 +229,7 @@ namespace NpgsqlTypes
default:
// This should not happen!
- throw new Exception(String.Format(resman.GetString("Exception_TypeNotSupported"), parameter.DbType));
+ throw new InvalidCastException(String.Format(resman.GetString("Exception_TypeNotSupported"), parameter.DbType));
}
@@ -309,7 +309,7 @@ namespace NpgsqlTypes
case DbType.StringFixedLength:
return data;
default:
- throw new Exception(String.Format(resman.GetString("Exception_TypeNotSupported"), oidToNameMapping[typeOid]));
+ throw new InvalidCastException(String.Format(resman.GetString("Exception_TypeNotSupported"), oidToNameMapping[typeOid]));
}
@@ -365,7 +365,7 @@ namespace NpgsqlTypes
case DbType.StringFixedLength:
return Type.GetType("System.String");
default:
- throw new Exception(String.Format(resman.GetString("Exception_TypeNotSupported"), oidToNameMapping[typeOid]));
+ throw new InvalidCastException(String.Format(resman.GetString("Exception_TypeNotSupported"), oidToNameMapping[typeOid]));
}