Skip to content
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

Merged
merged 5 commits into from
Oct 12, 2015
Merged

Conversation

appden
Copy link
Contributor

@appden appden commented Oct 12, 2015

No description provided.

@@ -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.");
Copy link
Contributor

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.

@alazier
Copy link
Contributor

alazier commented Oct 12, 2015

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.

@alazier
Copy link
Contributor

alazier commented Oct 12, 2015

Fixes #40

@alazier
Copy link
Contributor

alazier commented Oct 12, 2015

retest this please

appden added a commit that referenced this pull request Oct 12, 2015
Throw exceptions when not inside a transaction
@appden appden merged commit f5a1c3f into master Oct 12, 2015
@appden appden deleted the sk-transaction-fail branch October 12, 2015 20:03
alazier added a commit that referenced this pull request Mar 2, 2016
Test contains can be used as a property name in the parser
@pawellewandowski pawellewandowski mentioned this pull request Apr 14, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants