FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
159 stars 65 forks source link

Internal exception thrown [DNET118] #129

Closed firebird-automations closed 16 years ago

firebird-automations commented 16 years ago

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;";

   //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\);
 \}

Commits: FirebirdSQL/NETProvider@cfaec2adc8b09b6135186bef58dead9c58b833c0

firebird-automations commented 16 years ago
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\); \}
firebird-automations commented 16 years ago

Commented by: @carlosga

Fixed in SVN for 2.5 sources

firebird-automations commented 16 years ago
Modified by: @carlosga status: Open \[ 1 \] =\> Resolved \[ 5 \] resolution: Fixed \[ 1 \]
firebird-automations commented 16 years ago

Commented by: @carlosga

Fixed in SVN for 2.5.0 sources

firebird-automations commented 16 years ago
Modified by: @carlosga status: Resolved \[ 5 \] =\> Closed \[ 6 \]