Skip to content

Instantly share code, notes, and snippets.



Created Dec 1, 2016
What would you like to do?
Generates friendly trace info for pipe() / compose()
// Use like: trace("Friendly name", pipe)(map(...), filter(...), etc(...))
export const trace = (name, comp) => (...fns) => comp(, i) => {
return (...args) => {
try { return fn(...args); } catch(e) {
e.message = `Error in ${}() sequence ${name} at step ${i} (${ || '<anon>'}()): ${e.message}`;
throw e;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.