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

enhance/fix invalid argument exception string payload #368

Merged
merged 2 commits into from
May 23, 2017
Merged

enhance/fix invalid argument exception string payload #368

merged 2 commits into from
May 23, 2017

Conversation

domsj
Copy link
Contributor

@domsj domsj commented May 22, 2017

No description provided.

Copy link
Collaborator

@aantron aantron left a comment

Choose a reason for hiding this comment

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

Thanks. Lwt has a lot of misleading strings like these, and it's very good to fix them.

@@ -60,23 +60,23 @@ let blit_from_bytes src_buf src_ofs dst_buf dst_ofs len =
if (len < 0
|| src_ofs < 0 || src_ofs > Bytes.length src_buf - len
|| dst_ofs < 0 || dst_ofs > length dst_buf - len) then
invalid_arg "String.blit"
invalid_arg "Lwt_bytes.blit"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be "Lwt_bytes.blit_from_bytes"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

else
unsafe_blit_from_bytes src_buf src_ofs dst_buf dst_ofs len

let blit_to_bytes src_buf src_ofs dst_buf dst_ofs len =
if (len < 0
|| src_ofs < 0 || src_ofs > length src_buf - len
|| dst_ofs < 0 || dst_ofs > Bytes.length dst_buf - len) then
invalid_arg "String.blit"
invalid_arg "Lwt_bytes.blit"
Copy link
Collaborator

Choose a reason for hiding this comment

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

...and this "Lwt_bytes.blit_to_bytes"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and yes
see new commit

@aantron aantron merged commit 83e63c8 into ocsigen:master May 23, 2017
@aantron
Copy link
Collaborator

aantron commented May 23, 2017

Thanks again!

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.

None yet

2 participants