Add missing fields; add missing standard conformances; improve HTTP error reporting and configuration#36
Open
seansfkelley wants to merge 6 commits into
Open
Add missing fields; add missing standard conformances; improve HTTP error reporting and configuration#36seansfkelley wants to merge 6 commits into
seansfkelley wants to merge 6 commits into
Conversation
Example: Scryfall ID 54c92a0d-ab6e-45b2-b7a8-e13a5dd4e74e (https://scryfall.com/card/sld/1612/tovolar-dire-overlord-tovolar-the-midnight-scourge)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a grab bag of small changes I made over the course of developing my own project. It includes:
Card.flavorNameIdentifiableandCodableon a couple structs that should probably have it like many others doUser-Agentheader: Scryfall's API docs require that you identify yourself with a unique name and don't use library defaultsSorry it's a bit jumbled. I can split it if up if you'd prefer.
To be honest, the error handling improvements have in practice been pretty marginal, especially the decoding one. The HTTP error one was added after a spurt of 503/504s I got from Scryfall, which allowed me to tell users that Scryfall was down rather than the dreaded "unknown error" (combined with the error object's misleading explanation about decoding failures, which was not the root cause).