-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
improve deserialize error message #31374
improve deserialize error message #31374
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.
Much better. I think it might be clearer to say that if the serialize calls use the same serializer object then the corresponding deserialize calls should also use the same serializer object.
@@ -748,6 +748,21 @@ function resolve_ref_immediately(s::AbstractSerializer, @nospecialize(x)) | |||
nothing | |||
end | |||
|
|||
function gettable(s::AbstractSerializer, id::Int) | |||
if haskey(s.table, id) | |||
return s.table[id] |
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.
I would worry about the performance implications of this double lookup --- in the common case the key will be found.
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.
Can we use get(s.table, id, -1)
?
Or perhaps get(s.table, id, secret_table_token)
?
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.
Updated to use this form:
get(s.table, id) do
errmsg = ...
error(errmsg)
end
Wow, CI overload. I'm overwhelmed. |
Yeah, I have to confess the new CI output is pretty confusing. What's going on with this, @staticfloat? |
Yes, lots of new CI. This new CI has a separate checkmark for Julia building on each platform, and for testing on each platform. So, for instance, you can see that this PR built successfully on linux i686, linux x86_64, linux aarch64, and macOS x86_64. It did not test successfully on any of them though. Clicking We're still shaking out all the bugs of this CI system, and some of the problems (on systems like armv7l, which weren't tested very thoroughly before) have required merging some commits into |
Closing and reopening to restart CI |
Travis failures are unrelated. |
Ref: #31337 (comment)
If this is not the case, then an error can be triggered with the somewhat cryptic message:
This is an attempt to improve that error message.
Maybe the new message is too verbose or imprecise?
Or maybe there are other conditions which trigger the error?
In any case I submit this for your consideration.