Closed edmondchuc closed 2 years ago
Using Built-in Exceptions
would be ideal than writing custom Exceptions.
Simple solution would be to use the built-in KeyError
Exception
. Refactoring the codebase with Custom Exceptions
might make it harder for the maintainers, who have their own flow -- just something to think about before creating a PR.
hi @edmondchuc, does PR #69 solve this issue for you?
In a few places in
deta/base.py
exceptions are raised with theException
class.See https://github.com/deta/deta-python/blob/5e68173ffea4b3dd2c3d75fadda4e3c9854d3199/deta/base.py.
https://github.com/deta/deta-python/blob/5e68173ffea4b3dd2c3d75fadda4e3c9854d3199/deta/base.py#L134
https://github.com/deta/deta-python/blob/5e68173ffea4b3dd2c3d75fadda4e3c9854d3199/deta/base.py#L272
It'd be better practice if custom exceptions were defined and derived from the general
Exception
class.