Skip to content

Align error handling behavior #548

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

Merged
merged 7 commits into from
Nov 24, 2021
Merged

Align error handling behavior #548

merged 7 commits into from
Nov 24, 2021

Conversation

oshadmi
Copy link
Collaborator

@oshadmi oshadmi commented Nov 23, 2021

Maintain legacy behavior
And some tuning of new behavior

@oshadmi oshadmi requested a review from gkorland November 23, 2021 07:01
.into(),
),
},
_ => Ok(ObjectLen::NoneExisting),
Copy link
Collaborator

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
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
Collaborator

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

@@ -745,7 +745,7 @@ def testLenCommands(env):
r.assertEqual(r.execute_command('JSON.ARRLEN', 'test', '.arr'), 6)

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

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

Copy link
Collaborator

@MeirShpilraien MeirShpilraien left a comment

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
Copy link
Collaborator Author

oshadmi commented Nov 23, 2021

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

Build was failing

Copy link
Collaborator

@MeirShpilraien MeirShpilraien left a comment

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.

Copy link
Collaborator Author

@oshadmi oshadmi left a comment

Choose a reason for hiding this comment

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

Thanks!

.into(),
),
},
_ => Ok(ObjectLen::NoneExisting),
Copy link
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