Skip to content

Change #server_version to raise instead of return 0 on error#632

Merged
larskanis merged 4 commits into
ged:masterfrom
byroot:server-version-error
Mar 9, 2025
Merged

Change #server_version to raise instead of return 0 on error#632
larskanis merged 4 commits into
ged:masterfrom
byroot:server-version-error

Conversation

@byroot

@byroot byroot commented Mar 8, 2025

Copy link
Copy Markdown
Contributor

Ref: rails/rails#54712

Returning 0 on error is a bit uncommon in Ruby, and not very convenient, I think it would make more sense to raise the appropriate exception.

Now I understand that this is a bit of a breaking change, so I'd understand why you wouldn't want to merge this.

cc @joshuay03

byroot and others added 4 commits March 8, 2025 10:27
Ref: rails/rails#54712

Returning 0 on error is a bit uncommon in Ruby, and not very convenient,
I think it would make more sense to raise the appropriate exception.
with success and failure case.
@larskanis

Copy link
Copy Markdown
Collaborator

This makes sense. I added some more corresponding changes and tests, to make it more complete.

The error case is uncommon in these functions and these function are probably not in heavy use. I therefore think there aren't real world compatibility issues with this breaking change.

Thank you for the patch!

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