node-firebird icon indicating copy to clipboard operation
node-firebird copied to clipboard

.execute(execute procedure xxx) does not return proper error structure

Open ericlovescode opened this issue 10 years ago • 1 comments

I just tried to test my error handling with the following code:

this.copyProd = function(req, cb) {
 ppool.get(function(err, db) {
   if (err) {
     console.log("Ppool connection error: "+err);
     cb(err, null);
     return;
   }
   db.execute("execute procedure SP_COPYPRODUCT(?,?) reere", [req.params.pkey, req.session.ukey], 
     function (err, result) {
       db.detach();
       if (err) { console.log(err.message); cb(err,0); } else cb(err, result[0]);
   });  
 });  
};

The 'reere' string will generate a -104 exception ("Dynamic SQL Error, SQL error code = -104, Token unknown - line 1, column 39, reere"). The error message is in error.message as usual, but other error structure fields are not set, such as error.sqlcode.

Cheers. Eric.

ericlovescode avatar Nov 14 '14 04:11 ericlovescode

Hi @ericlovescode, sorry I forgot for your issue. Please try to test now. Thanks.

petersirka avatar Nov 20 '14 21:11 petersirka