-
Notifications
You must be signed in to change notification settings - Fork 48
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
Error object returned from connect where mapped tables do not exist needs more information #25
Comments
clr% node tweet.js get tweets-at nero
Craig
Craig L RussellArchitect, Oraclehttp://db.apache.org/jdo408 276-5638 mailto:[email protected]. A good JDO? O, Gasp! |
Now the error message is much better if the tables are not found, but there is still one problem. If you fail to connect because you really can't connect to the server, you get error 08000 "Connection Failed". However, if you can't connect to the server and you tried to validate 5 mappings, you get the five 42S02 "No such table existed" errors but not the 08000 error. Since the 08000 "Connection Failed" is the root cause it seems that this should be the error the user sees. Reopening issue. |
Let’s discuss. UserContext.getSessionFactory mapping errors [Error:
Craig L RussellArchitect, Oraclehttp://db.apache.org/jdo408 276-5638 mailto:[email protected]. A good JDO? O, Gasp! |
The error object should also include the code, errno, and sqlState of the first failed mapping. |
openSession() and connect() can be used to validate mappings.
If the mappings are not valid, the error returned by connect() is strange. For instance, if five mappings were to be validated, and all five received errors, the error object seems to be an array of five elements, but the prototype of the array is Error. I tried using a variety of console.log(), util.inspect(), etc. to view the five members of this structure but I was not able to.
The docs in API-documentation/Jones are not clear about whether a failure to validate the mappings causes openSession() or connect() to fail.
One way to reproduce this:
cd samples/tweet
neglect to create the tables used by tweet.js
node tweet.js get tweets-at nero
The text was updated successfully, but these errors were encountered: