There are some cases where a IscException is thrown. But IscException is internal of the Assembly Firebird and it cannot be treated out by ours applications.
I think all IscException thrown should be encapsulated in FbException.
An example :
//When the database is on a distant machine the IscException is not encapsulated
try
{
FbBackup fbBackup = new FbBackup();
fbBackup.ConnectionString = @"DataSource=distantmachinename;Database=C:\Program Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB; " +
"User=user;Password=password;Role=;Port=3050;Connection lifetime=;Connection timeout=;"+
"Pooling=true;MaxPoolSize=1;Dialect=3;Charset=NONE;Packet Size=8192;Server Type=0;";
//I specify 2 backup files with the same name
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 1048576\)\);
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 0\)\);
fbBackup\.Verbose = true;//Verbose must be true else no exception is thrown ???
fbBackup\.Execute\(\);
\}
catch \( FbException e \)
\{
Console\.WriteLine\(e\.ErrorCode \+ " \| " \+ e\.Message\);
\}
catch \( Exception e \)
\{
//the exception is catched here and cannot be cast to an IscException
Console\.WriteLine\(e\.Message\);
\}
Modified by: Thomas Gaboriau (tgaboriau)
description: There are some cases where a IscException is thrown\. But IscException is internal of the Assembly Firebird and it cannot be treated out by ours applications\.
I think all IscException thrown should be encapsulated in FbException\.
An example :
//When the database is on a distant machine the IscException is not encapsulated
try
\{
FbBackup fbBackup = new FbBackup\(\);
fbBackup\.ConnectionString = @"DataSource=distantmachinename;Database=C:\\Program Files\\Firebird\\Firebird\_1\_5\\examples\\EMPLOYEE\.FDB; " \+
"User=user;Password=password;Role=;Port=3050;Connection lifetime=;Connection timeout=;"\+
"Pooling=true;MaxPoolSize=1;Dialect=3;Charset=NONE;Packet Size=8192;Server Type=0;";
//I specify 2 backup files with the same name
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 1048576\)\);
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 0\)\);
fbBackup\.Execute\(\);
\}
catch \( FbException e \)
\{
Console\.WriteLine\(e\.ErrorCode \+ " \| " \+ e\.Message\);
\}
catch \( Exception e \)
\{
//the exception is catched here and cannot be cast to an IscException
Console\.WriteLine\(e\.Message\);
\}
=\>
There are some cases where a IscException is thrown\. But IscException is internal of the Assembly Firebird and it cannot be treated out by ours applications\.
I think all IscException thrown should be encapsulated in FbException\.
An example :
//When the database is on a distant machine the IscException is not encapsulated
try
\{
FbBackup fbBackup = new FbBackup\(\);
fbBackup\.ConnectionString = @"DataSource=distantmachinename;Database=C:\\Program Files\\Firebird\\Firebird\_1\_5\\examples\\EMPLOYEE\.FDB; " \+
"User=user;Password=password;Role=;Port=3050;Connection lifetime=;Connection timeout=;"\+
"Pooling=true;MaxPoolSize=1;Dialect=3;Charset=NONE;Packet Size=8192;Server Type=0;";
//I specify 2 backup files with the same name
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 1048576\)\);
fbBackup\.BackupFiles\.Add\(new FbBackupFile\("samename\.fbk", 0\)\);
fbBackup\.Verbose = true;//Verbose must be true else no exception is thrown ???
fbBackup\.Execute\(\);
\}
catch \( FbException e \)
\{
Console\.WriteLine\(e\.ErrorCode \+ " \| " \+ e\.Message\);
\}
catch \( Exception e \)
\{
//the exception is catched here and cannot be cast to an IscException
Console\.WriteLine\(e\.Message\);
\}
Submitted by: Thomas Gaboriau (tgaboriau)
Assigned to: @carlosga
There are some cases where a IscException is thrown. But IscException is internal of the Assembly Firebird and it cannot be treated out by ours applications.
I think all IscException thrown should be encapsulated in FbException.
An example :
//When the database is on a distant machine the IscException is not encapsulated try { FbBackup fbBackup = new FbBackup(); fbBackup.ConnectionString = @"DataSource=distantmachinename;Database=C:\Program Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB; " + "User=user;Password=password;Role=;Port=3050;Connection lifetime=;Connection timeout=;"+ "Pooling=true;MaxPoolSize=1;Dialect=3;Charset=NONE;Packet Size=8192;Server Type=0;";
Commits: FirebirdSQL/NETProvider@cfaec2adc8b09b6135186bef58dead9c58b833c0