Skip to content

📑 dictionary lookups can return none#69

Merged
aturon merged 7 commits into
mainfrom
katie/dictionary-lookups-return-none
Sep 2, 2021
Merged

📑 dictionary lookups can return none#69
aturon merged 7 commits into
mainfrom
katie/dictionary-lookups-return-none

Conversation

@cratelyn
Copy link
Copy Markdown

Fixes #68.

this branch makes some follow-up changes to #61, modifying the hostcall so that we return a None status code when a dictionary entry does not exist.

@cratelyn cratelyn added the bug Something isn't working label Aug 30, 2021
@cratelyn cratelyn self-assigned this Aug 30, 2021
@cratelyn cratelyn marked this pull request as ready for review August 30, 2021 15:25
@cratelyn cratelyn requested a review from aturon August 30, 2021 15:25
Comment thread lib/src/wiggle_abi/dictionary_impl.rs Outdated
pub enum DictionaryError {
/// A dictionary item with the given key was not found.
#[error("Unknown dictionary item")]
UnknownDictionaryItem,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Quick question: what's the rationale for dropping the string paylaod here? Viceroy prints out the errors prior to converting them to ABI codes, and it seems helpful to provide that info.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ah! excellent point, thank you. i have fixed this in a0e80c6. ✨

Copy link
Copy Markdown
Member

@aturon aturon 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 except for one small question!

> Viceroy prints out the errors prior to converting them to ABI codes,
> and it seems helpful to provide that info.

a wise point! this commit reintroduces the payload of
`UnknownDictionaryItem`.

Co-Authored-By: Aaron Turon <aturon@fastly.com>
@cratelyn cratelyn requested a review from aturon August 31, 2021 14:28
Copy link
Copy Markdown
Member

@aturon aturon left a comment

Choose a reason for hiding this comment

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

Fab! ✨

@cratelyn
Copy link
Copy Markdown
Author

  = note: LINK : fatal error LNK1285: corrupt PDB file 'D:\a\Viceroy\Viceroy\target\debug\deps\http_semantics-39397fc60f086e09.pdb'; delete and rebuild

i'm guessing latent CI failure, we shall see ♻️

@aturon aturon merged commit 0157d82 into main Sep 2, 2021
@aturon aturon deleted the katie/dictionary-lookups-return-none branch September 2, 2021 18:37
@cratelyn cratelyn mentioned this pull request Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fastly crate panicking when a dictionary item doesnt exist

2 participants