Skip to content
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

Catch colormap encoding issues #275

Closed
vincentsarago opened this issue Mar 24, 2021 · 0 comments · Fixed by #279
Closed

Catch colormap encoding issues #275

vincentsarago opened this issue Mar 24, 2021 · 0 comments · Fixed by #279
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@vincentsarago
Copy link
Member

When the colormap is wrongly encoded the application returns something like

{"detail":"Expecting value: line 1 column 1 (char 0)"}

We should try to catch this in

if colormap:
return json.loads(
colormap,
object_hook=lambda x: {int(k): parse_color(v) for k, v in x.items()},
)

and return a better error message

@vincentsarago vincentsarago self-assigned this Mar 24, 2021
@vincentsarago vincentsarago added enhancement New feature or request good first issue Good for newcomers labels Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant