RunKit + npm: fault-tolerance

node v10.24.1
version: 1.0.0
endpointsharetweet
var Fault = require("fault-tolerance").Fault function redactUserInformation(context){ delete context.address; delete context.phone; delete context.emailAddress; return context; } function process(user){ // pretend we did something; throw new Error('could not process user'); } function processClaim(user){ try{ process(user); } catch(e){ e = new Fault(e, user, redactUserInformation); console.log(e.log); } } processClaim({address:'foo', phone:1234567890, emailAddress:'joe@example.org', id:123, claimId:456})
Created from: https://npm.runkit.com/fault-tolerance
Loading…

no comments

    sign in to comment