Age | Commit message (Collapse) | Author |
|
|
|
This sprinkles in some thiserror and anyhow instead of the hand-rolled
'error_froms!' macros and the MainResult. The benefit of this is that
we're hooking into an established ecosystem of error handling and we're
saving a lot of effort in the hand-written Display and Error
implementations.
The reason for not sprinkling anyhow everywhere is because the
retrieval/rendering part of kondou could be split off into a library at
some point, in which case we want to have a proper KondouError type.
However, the argument could be made that the current split of errors is
not very good, especially because many of them boil down to the same
inner errors (RenderError wrapping ApiError wrapping reqwest::Error),
which keeps unnecessary information.
Some future improvements may include
1.) Unifying those error enums into one bigger enum
2.) Attaching more context through anyhow in the application layer
3.) Properly define an API and split off the inner logic from the UI
logic
|
|
image should also be updated to 0.23, but imageproc currently still uses
0.22, so we need to match it.
|
|
Now that the API actually returns the proper palette IDs, we can use
those values instead of relying on the hard coded values.
This also gets rid of the make_table script that was mostly hackish
anyway, and the lazy static HashMap.
|
|
The cache is meant to help out by saving old responses. If those
responses do not conform anymore to an updated struct definition, the
whole application should not crash. Instead, the value is silently
ignored and then overwritten by the proper value that has been fetched
from the API.
That way, users don't have to manually clear out the cache if a new API
schema or new features are released.
|
|
As it looks, not every trait comes with this field, which prevents some
traitlines (notably the Firebrand one) from rendering successfully, as
serde refuses to deserialize the Trait.
We never displayed the description, and it's trivial to add back, so
that's why it was removed.
|
|
quick_error used the deprecated Error::cause interface, therefore we
want to use our own error enums with proper methods.
|
|
|
|
|
|
|
|
|