Skip to content

Conversation

lerwys
Copy link

@lerwys lerwys commented Aug 18, 2021

Not sure if this is the right approach, but it's a first working take, at least.

errlogPrintf("dbExceptionToLong: Unhandled exception\n");
/* Return something more meaningful? */
return S_db_errArg;
}
Copy link
Owner

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().

Copy link
Author

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

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good.


INC += callback.h
INC += dbAccess.h
INC += dbAccessNoThrow.h
Copy link
Owner

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).

Copy link
Author

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.

lerwys added 2 commits August 18, 2021 08:22
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.
@AppVeyorBot
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants