-
Notifications
You must be signed in to change notification settings - Fork 177
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
Conversation
There was a problem hiding this 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.
src/unix/lwt_bytes.ml
Outdated
@@ -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" |
There was a problem hiding this comment.
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"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
src/unix/lwt_bytes.ml
Outdated
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" |
There was a problem hiding this comment.
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"
?
There was a problem hiding this comment.
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
Thanks again! |
No description provided.