Giter Club home page Giter Club logo

iced-error's People

Contributors

lfreneda avatar maxtaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

keybase lfreneda

iced-error's Issues

Other annoying things about dealing with errors in ICS

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.

usage

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.