Comments (8)
@jeroldhaas In most languages on the CLR, all exceptions derive from System.Exception
. It's really odd to ever encounter one that doesn't (it's possible with C++/CLI to throw other things, but the docs recommend always deriving from System.Exception, and if you don't, you'll mess up almost everybody)
from gjallarhorn.
My immediate thought was the same, I think. CustomExceptions
implementing IObservable
, or simply IObservable<IException>
, or something else?
from gjallarhorn.
@jeroldhaas I'm thinking something like:
let exceptions = Signal.catch someSignal
This would result in exceptions being IObservable<Exception>
, which could then be subscribed/filtered/etc using the Observable
module or Rx functionality as needed
from gjallarhorn.
But this would require a general mechanism for propagating exceptions through (similar to IObserver's mechanism), as well as the ability to subscribe to them somewhere - perhaps via Signal.Subscription.subscribe
as well as via a custom mapper (like the above).
from gjallarhorn.
My reasoning for IException
as the contained type for IObservable
was for extendability by passing various forms of Exception
types that other frameworks would likely try passing on to F#.
Can subscribers operate in a serial pipeline? To clarify, Signal.Subscription.subscribe
previous to ErrorSignal.Subscription.subscribe
in a pipeline, or would be too much? I don't see any reason why software can't have more than one Subscriber
.
from gjallarhorn.
@jeroldhaas The problem with IException is that it won't work against standard exceptions, so a "global" exception handler wouldn't just push into it. That's why I was suggesting IObservable<Exception>
- any framework exception could map through to that.
There is nothing stopping multiple subscriptions on a "pipeline". I was actually thinking more along the lines of having Signal.catch
or Signal.handle
type of functionality which would act as a "handler", and still allow normal values to flow through the system.
from gjallarhorn.
@ReedCopsey I'd looked up the MSDN docs on IException (as I'd thought there was a possibility that it already existed); my idea was to create an interface that would contain the Exception
as one of its fields.
After thinking on your solution, I'm guessing that a guard that checks to see if a special Exception
type is derived from the Exception
type, that should suffice.
from gjallarhorn.
Closing this for now - given the nature of signals (always having a value, etc), this doesn't seem to be a major issue in practice, at least not yet. Going to leave the design alone unless something comes up where this becomes a necessity.
from gjallarhorn.
Related Issues (20)
- Problem with loading resources in Wpf.Framework HOT 1
- Validation issue in Binding.mutateToFromViewValidated HOT 4
- Request for Feedback: Update HOT 5
- Elm module HOT 12
- Possible crash issue in BoundCollection
- Add a .Net "standard" version. HOT 16
- Add documentation for Binding API HOT 1
- Add a sample walkthrough which documents how to bind signals in a simple app using this lib HOT 2
- Question: 'Back propogation' from values HOT 5
- Subscriptions fire when mutable is set to same value HOT 5
- What is blocking creating signals from the standard mutables HOT 4
- Unexpected subscription notifications
- Multi targeting
- Errors in CoreTypes.fs HOT 1
- Migration to the FAKE 5
- Validators.containedWithin<RecordType> -> System.FormatException HOT 1
- .Add notifies even when underlying value has not changed HOT 2
- How to build the project? HOT 1
- Errors resulting from 'as self' HOT 5
- `lift` has an unused input
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 gjallarhorn.