-
Notifications
You must be signed in to change notification settings - Fork 586
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
Throw exceptions when not inside a transaction #43
Conversation
@@ -98,6 +98,10 @@ namespace realm { | |||
{ | |||
using Accessor = NativeAccessor<ValueType, ContextType>; | |||
|
|||
if (!realm->is_in_transaction()) { | |||
throw std::runtime_error("Can only set property values within a transaction."); |
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.
We should make a new exception
type for mutating outside of an exception and throw this new exception type whenever this occurs.
This looks good 👍 We will want to define a new exception type for mutations outside of write transactions, as other platforms will need to catch this and possibly handle this specific cases anywhere we throw from the shared object store code. We don't need to do this right now but should do it before pushing our object store changes to the shared repo. |
Fixes #40 |
retest this please |
Throw exceptions when not inside a transaction
Test contains can be used as a property name in the parser
No description provided.