maxtaco / iced-error Goto Github PK
View Code? Open in Web Editor NEWEnumerated error codes, with descriptions and Error object types
Enumerated error codes, with descriptions and Error object types
Hi-
Not sure if you'd prefer a different channel for this kind of communication, but this seemed maybe better than e-mail/twitter...
Not really an issue with this repo specifically, but I've been using Iced Coffee Script for a project I've been working on for a few days, and I wrote a module to make some of the things I was doing over-and-over again a little bit easier.
https://github.com/ccheever/iced-cream
In general, I've been writing code with much more verbose and explicit logging of errors than most of the example code I've seen. This module makes that style a little easier at least.
The ErrorShortCircuiter in this repo seems interesting/promising. You might want to consider mentioning it on the ICS homepage. Getting the hang of how to handle errors reasonably in the async/callback driven world was one of the trickier things about ICS and generally makes me feel like I'm doing lots of typing to get anything done, mostly just handling error cases.
I my test script index.iced
{make_esc} = require "iced-error"
bar = (cb) ->
esc = make_esc cb, "bar"
# ...
return cb "failed" # if statement
# ...
foo = (cb) ->
esc = make_esc cb, "foo"
# ...
await bar esc defer result
cb null, "success"
do ->
await foo defer error, result
console.log {error, result}
I am waiting for {error: "failed", result: undefined},
but received
TypeError: Cannot call method 'push' of undefined
at ipush (/home/user/project/node_modules/iced-error/index.js:82:23)
at /home/user/project/node_modules/iced-error/index.js:95:11
at bar (/home/user/project/index.iced:8:10)
at /home/user/project/index.iced:17:9
at foo (/home/user/project/index.iced:17:3)
at console.log.error (/home/user/project/index.iced:21:9)
at /home/user/project/index.iced:21:3
at Object.<anonymous> (/home/user/project/index.iced:20:1)
at Object.<anonymous> (/home/user/project/index.iced:1:1)
at Module._compile (module.js:456:26)
What is the right way to use iced-error?
thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.