caolan / highland

High-level streams library for Node.js and the browser
https://caolan.github.io/highland
Apache License 2.0
3.43k stars 147 forks source link

Produce better error messages #94

Open greelgorke opened 10 years ago

greelgorke commented 10 years ago

this discussion is a fork from #79 .

@caolan said

we should probably make that a nicer error message! (pull requests welcome for that)

@greelgorke said:

attempt is to check for the value being a highland stream (or feature-detect, but it's less reliable in our case) and to produce an error if it doesn't pass the check (instead of throwing)

@caolan also said:

We currently don't wrap iterator (eg, map, filter...) calls with try/catch in order to pass those sync errors down the pipeline but we probably should!

greelgorke commented 10 years ago

also i would like to name all the functions, so the stack traces become readable.

caolan commented 10 years ago

@greelgorke yep, that's a good idea +1

greelgorke commented 10 years ago

about the naming. since highland is facing the browser-land we have to consider jscript and other fellows

we could however implement it so it will work in all browsers, but that means basically to refactor most function expressions to statements. there are many of them

vqvu commented 10 years ago

We currently don't wrap iterator (eg, map, filter...) calls with try/catch in order to pass those sync errors down the pipeline but we probably should!

I need this feature, so I can take a shot if no one else is working on it. @greelgorke?

greelgorke commented 10 years ago

@vqvu i'm currently justworking on funktion names and checking for highland streams in higher-order streams. nothing with try/catch