Comments (2)
This is how a solution could look like for python:
class DsfException(Exception):
"""Base class for all DSF exceptions"""
def __init__(self, message):
super().__init__(message)
class InternalServerException(DsfException):
"""Exception returned by the server for an arbitrary problem"""
def __init__(self):
super().__init__("Internal Server Exception")
class ErrorResponseException(DsfException):
"""Exception returned if an Error Response is received"""
def __init__(self, error_type: str, error_message: str):
super().__init__("{}: {}".format(error_type, error_message))
This is an incomplete overview of found errors
- NotImplementedError Error: M3: Command is not supported in machine mode FFF
- NotImplementedError Error: Operation is not supported
- NotImplementedError Error: M260: I2C not available
- MissingParameter Error: M42: missing parameter 'P' or Error: M118: missing parameter 'S' or Error: M307: missing parameter 'H' or Error: M581: missing parameter 'T' or Error: M591: missing parameter 'D'
- OutOfRangeError Error: M593: parameter 'F' too low
- DeprecationWarning Error: M305: M305 has been replaced by M308 and M950 in RepRapFirmware 3
- FileNotFoundError Error: M24: Cannot print, because no file is selected!
- AlreadyStopped Error: M25: Cannot pause print, because no file is being printed!
- SHA1Error Error: M38: Could not compute SHA1 checksum for file F a l s e: Could not find file '/F a l s e'.
- FileNotFound Error: M375: Failed to load height map from file heightmap.csv: Could not find file '/opt/dsf/sd/sys/heightmap.csv'.
- DirectoryNotFound Error: M470: Missing directory name
- RenamingError Error: M471: Failed to rename file or directory to : Value cannot be null. (Parameter 'input')
- NetworkError Error: M540: Network-related commands are not supported when using an attached Single Board Computer
- InvalidStateError Error: M585: a axis has not been homed
from dsf-python.
Clarification is needed here for go language as well.
Go uses instances of structerror
for error handling. You can either return an generic error message by creating it via ```
errors.New("error message")
or create pseudo-static instances like
var ErrSomeDecriptiveName = errors.New("error message")
and then the user can compare against this instance.
AFAIR the Go impl already returns errors where appropriate.
from dsf-python.
Related Issues (11)
- InterceptConnection flush no longer takes Channel argument HOT 5
- Import everythin when importin top level module
- [FeatureRequest]: long live connection support
- [Bug]: dcs.sock file not found, Multiple attempts to try and connect to Duet via SBC and Windows machine HOT 2
- Create pypi.org package for dsf-python HOT 4
- Update module for upcoming release 3.3
- Test and evaluate test infrastructure HOT 1
- Get repo working after repo split HOT 1
- Fix test_custom_m_codes
- Socket filename incorrect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsf-python.