Skip to content

We need user-friendly errors #18

@spficklin

Description

@spficklin

If you run the scald analysis and you give it an empty directory you get the following message.

Traceback (most recent call last):
  File "/home/ficklin/.local/bin/granny", line 8, in <module>
    sys.exit(run())
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/GrannyBase.py", line 76, in run
    iface.run()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 59, in run
    result_images = analysis.performAnalysis()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Analyses/SuperficialScald.py", line 263, in performAnalysis
    self.output_results.writeValue()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Models/Values/MetaDataValue.py", line 38, in writeValue
    image_rating = image_rating.sort_values(by="Name").reset_index(drop=True)
  File "/home/ficklin/.local/lib/python3.10/site-packages/pandas/core/frame.py", line 7189, in sort_values
    k = self._get_label_or_level_values(by[0], axis=axis)
  File "/home/ficklin/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 1911, in _get_label_or_level_values
    raise KeyError(key)
KeyError: 'Name'

We need to do some stress testing and make sure that when people make such mistakes they get a friendly message telling them what they did wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions