-
Notifications
You must be signed in to change notification settings - Fork 2
Convert RecSup function possible exceptions to dbAccess error codes #3
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
base: vfield
Are you sure you want to change the base?
Conversation
errlogPrintf("dbExceptionToLong: Unhandled exception\n"); | ||
/* Return something more meaningful? */ | ||
return S_db_errArg; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is much value in translating specific exceptions.
It might be more useful to print the specific exception type typeid(e).name()
along with e.what()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Is S_db_errArg a good error for this general "unhandled exception" case?
|
||
/* | ||
* Wraps all RecordSupport functions from throwable functions to no-throwable ones, | ||
* without using C++11 features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this does give a good example of why I didn't do this initially. For the moment, let's only add wrappers as they used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good.
modules/database/src/ioc/db/Makefile
Outdated
|
||
INC += callback.h | ||
INC += dbAccess.h | ||
INC += dbAccessNoThrow.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header should not be installed (aka. become a supported public API).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I will remove this.
New record support functions, especially when using DBR_VFIELD, might throw exceptions that would not be handled in C code, leading to undefined behavior. This patch attempts to safely convert exceptions into error codes so dbAccess might act upon them correctly.
❌ Build epics-base base-vfield-750 failed (commit c6c4c24535 by @lerwys) |
Not sure if this is the right approach, but it's a first working take, at least.