Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal exception thrown [DNET118] #129

Closed
firebird-automations opened this issue Sep 20, 2007 · 5 comments
Closed

Internal exception thrown [DNET118] #129

firebird-automations opened this issue Sep 20, 2007 · 5 comments

Comments

@firebird-automations
Copy link

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: cfaec2a

@firebird-automations
Copy link
Author

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
Copy link
Author

Commented by: @carlosga

Fixed in SVN for 2.5 sources

@firebird-automations
Copy link
Author

Modified by: @carlosga

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Commented by: @carlosga

Fixed in SVN for 2.5.0 sources

@firebird-automations
Copy link
Author

Modified by: @carlosga

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant