U2Py Error Handling
I am building an ODM/ORM for my system in Python. With the intent of making my queries and writes into UV more pythonic and easier to code (I am VERY lazy). For me this is primarily allowing read and writes to and from UV with a Python dictionary leveraging the readnamedfields() and writenamedfield() within the u2py.File class. While I have a specific issue below, I think there is room for a general discussion around u2Py error handling.
My specific issue lies in getting "u2py.U2Error: (3) unknown " back in my trace. I am getting this error back when trying to write data to a record I have open in editor (so the file is locked). While I would expect to get an error here, I would also expect that error to be a little more descriptive of what the issue is.
I have a couple questions that should hopefully give me a good path forward here...
1. Are there plans to improve the u2Py module's error handling in the near term future?
2. Does the (3) in my error mean/represent anything? (I could parse this to get what I need if it does)
3. has anyone built their own error class within the U2Py module to resolve issues like this? If so, I'd love to hear about it.
My plan is to use the u2py.File's islocked() method to catch the error and make a check and raise a more specific error, (u2py.FileLockedError or something) but if it has already been done, I hate to reinvent the wheel.
I'm going to mark this an "Open ended Discussion" post in the hopes that a discussion can arise surrounding U2Py Errors. Admins, my feelings will not be hurt if this post is changed to a question instead.
------------------------------
Nic Davidson
Developer
Combined Transport
OR United States
------------------------------
My specific issue lies in getting "u2py.U2Error: (3) unknown " back in my trace. I am getting this error back when trying to write data to a record I have open in editor (so the file is locked). While I would expect to get an error here, I would also expect that error to be a little more descriptive of what the issue is.
I have a couple questions that should hopefully give me a good path forward here...
1. Are there plans to improve the u2Py module's error handling in the near term future?
2. Does the (3) in my error mean/represent anything? (I could parse this to get what I need if it does)
3. has anyone built their own error class within the U2Py module to resolve issues like this? If so, I'd love to hear about it.
My plan is to use the u2py.File's islocked() method to catch the error and make a check and raise a more specific error, (u2py.FileLockedError or something) but if it has already been done, I hate to reinvent the wheel.
I'm going to mark this an "Open ended Discussion" post in the hopes that a discussion can arise surrounding U2Py Errors. Admins, my feelings will not be hurt if this post is changed to a question instead.
------------------------------
Nic Davidson
Developer
Combined Transport
OR United States
------------------------------