-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Exception handling in dl-cpp: driplineorg/dripline-cpp#103
The primary execution of most actions in dl-py takes place in C++, so most error handling will end up in the C++ code. Between C++ and Python the typical sequence of stages is Caller (Python) --> Execution (C++) --> Details (Python). Details includes things like doing calibrations. Most time is spent in the Execution and Details stages, and the Execution stage is typically responsible for the final error handling and making decisions about whether to exit the application. So we need to ensure that the error handling drops back to the C++ in the right ways.
Caller stage
- dl-serve
- Calls
service::listen()and checks boolean return - Raises RuntimeError to exit if necessary
- Calls
Execution stage
See driplineorg/dripline-cpp#103
Details stage
- ✅ AlertConsumer
- Does not raise exceptions
- ❌ Calibrate
calibration()- raises
exceptions.DriplineValueError - This is the calibration decorator, which will be called when responding to a request
- Therefore this is not the right use of
DriplineValueError
- raises
- ✅ Endpoint
- Several functions
- Raises only ThrowReply
- Several functions
- ❓ Entity
- Several functions
- Raise ValueError
- Question Is this right? Are these caught somewhere?
- Several functions
- ✅ Interface
_send_request()- Raises DriplineError
- Called by
get(),set(), andcmd()- Not caught
- Will pass exception up to the user of Interface
- ✅ ReturnCodes.py
- Does not raise exceptions
- ✅ ThrowReply
- Does not raise exceptions
I have not checked any code in Implementations.
Metadata
Metadata
Assignees
Labels
No labels