Comments (5)
Here is a PR which solves my various needs - resilience regarding callback exceptions, and ordered shutdown: #54
from oscpy.
closed in #54
from oscpy.
I'm not a fan of eating errors, but maybe we could give a way for the user to handle exceptions in a way they see fit with such a try/except Exception construct, i think i would raise in the absence of such an error handler value, to avoid this being a surprising property of the system, but still allow users to opt into a more resilient mode.
from oscpy.
I think most server frameworks (Django, Flask etc.) handle each request as a separate "task", and have a catch-all which log unhandled exceptions (including traceback), or perform other signalling (eg. sending emails to admins).
I guess a catch-all like that, relying on stdlib logging, would be just fine. It could be switchable by an init argument of the server indeed, even though I wonder: are there cases where having the server stop all operation on error is useful (since it's using UDP and handled by a secondary thread, it makes a quite silent error anyway, doesn't it ?)
(I could work on a PR once we see how it should preferably be done)
from oscpy.
Indeed the fact that it's in a thread makes it less obvious that would be desirable that something went wrong, if you want to work on this, as long as it's possible to register a custom error handler so the calling program can be aware of error and plug whatever report logic it wants, i think that would be fine, and the default behavior could be to log the error, which is indeed better than the current behavior, since it can process further requests. Make sure the error handling interface is described in the server documentation, so it can be easily discovered, and to add tests for the behavior :).
from oscpy.
Related Issues (20)
- Android - iOS: get_sender() not called from a callback in file HOT 5
- Delay between close() and reopening a server HOT 1
- CPU usage getting high after opening/closing server many times HOT 2
- closed remote connection on windows. HOT 1
- New Windows issue (with current code including fix #48) HOT 3
- Clarify blob handling. HOT 12
- No route to host results in crash HOT 1
- Activity and Service don't respond to messages from one another on Android HOT 2
- Async oscpy, question, help ! HOT 1
- Server callback error handling HOT 4
- An example to send and receive a bundle HOT 1
- Listener thread died because of unable to parse a packet HOT 8
- blob packing exception
- Add option to demonstrate persistent service
- Cannot oscli send -> oscli dump without raising exception HOT 4
- Blob size unpack_from with wrong unit HOT 2
- Using tag from a displax screen make listener thread crash HOT 3
- Unable to change port using listen method
- Example code in ReadMe won't run.
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 oscpy.