Skip to content

Align error handling behavior - #548

Merged
oshadmi merged 7 commits into
masterfrom
omer_err_handling
Nov 24, 2021
Merged

oshadmi merged 7 commits into
masterfrom
omer_err_handling

Conversation

@oshadmi

@oshadmi oshadmi commented Nov 23, 2021

Copy link
Copy Markdown
Collaborator

Maintain legacy behavior
And some tuning of new behavior

@oshadmi
oshadmi requested a review from gkorland November 23, 2021 07:01
Comment thread src/commands.rs
.into(),
),
},
_ => Ok(ObjectLen::NoneExisting),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Doesn't it make more sense that this is an error?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, in new behavior it is an error (see json_obj_len). This is to maintain legacy behavior.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So why add it as part of the valid return value and not as error?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just for backward compatibility with V 1.0 (only with legacy path)
JSON.OBJKEYS doc1 .nowhere and JSON.OBJKEYS no_such_doc . should return null (as before)

Comment thread src/commands.rs Resolved
Comment thread tests/pytest/test.py Outdated

# test elements with undefined lengths
r.assertEqual(r.execute_command('JSON.ARRLEN', 'test', '.bool'), None)
r.expect('JSON.ARRLEN', 'test', '.bool').raiseError()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let add .contains with a substring we expect to see in the error

Comment thread tests/pytest/test_multi.py Resolved
Comment thread tests/pytest/test_multi.py Resolved
Comment thread tests/pytest/test_multi.py Resolved
Comment thread tests/pytest/test_multi.py Resolved
Comment thread tests/pytest/test_multi.py Resolved

@MeirShpilraien MeirShpilraien left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, some comments.
Also why did you updated readies submodule?

@oshadmi

oshadmi commented Nov 23, 2021

Copy link
Copy Markdown
Collaborator Author

Looks good, some comments. Also why did you updated readies submodule?

Build was failing

@MeirShpilraien MeirShpilraien left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added one followup question on one of the comment, but no a blocker.

@oshadmi oshadmi left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks!

Comment thread src/commands.rs
.into(),
),
},
_ => Ok(ObjectLen::NoneExisting),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just for backward compatibility with V 1.0 (only with legacy path)
JSON.OBJKEYS doc1 .nowhere and JSON.OBJKEYS no_such_doc . should return null (as before)

@oshadmi
oshadmi merged commit c7fd240 into master Nov 24, 2021
@oshadmi
oshadmi deleted the omer_err_handling branch November 24, 2021 08:28
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.

2 participants