Improve exceptions and the error messages#569
Improve exceptions and the error messages#569computron merged 4 commits intomaterialsproject:mainfrom
Conversation
|
Thanks! Can you rename the exceptions either according to: FWSerializationError (similar to FWAction) |
|
@computron Thank you for your prompt response! I hezitate to change everywhere inspecific exceptions are raised. Mainly due to backwards compatibility of the API because user codes may rely on certain type of exceptions. But I did replace |
I think we are OK since |
Closes #568
Summary
Exceptions and error messages should be sufficiently specific to allow the API users decide what exactly did not work and to make corrections (i.e. to handle the exceptions) accordingly. Catching and raising broad exceptions is not helpful for the correct handling.
Major changes:
feature 1: exception module with basic exceptions:
fix 1: raise exception when the read content is not a dict but obvious has to be
Disclaimer: The backward compatibility of the API is not fully maintained for all new exceptions. But the messages of all exceptions stay unchanged.
Todos
If this is work in progress, what else needs to be done?
Checklist
ruff.mypy.If applicable, new classes/functions/modules haveduecredit@due.dcitedecorators to reference relevant papers by DOI (example)Tip: Install
pre-commithooks to auto-check types and linting before every commit: