tessel/camera-vc0706 — pull request #34 by LinusU (2014-11-22 14:55:36+00:00)
Title: stellar error handling

In response to #31 | fixes #32 and #33 | ping @johnnyman727

What I did:

- Cleaned up the error handling
- Make sure to never call callback twice
- Removed unused `tessel` and `DEBUG`
- Converted two "programmer errors" to `throw` [1]
- Converted `var self = this` to `.bind(this)` [2]
- Ran the code thru JSLint and JSHint (didn't fix whitespace)

[1] https://www.joyent.com/developers/node/design/errors
[2] Since `bind` was used in all but one place

The only problem is that **I haven't tested the code** with an actual camera. I know that the code is valid javascript because I've uploaded it to the tessel, but I haven't tried actually connecting to a camera. Unfortunately I won't be able to do that since I don't own the camera module.

If someone could help me test, it would be greatly appreciated! Run the following code with the camera attached to port A.

```sh
git clone https://github.com/LinusU/camera-vc0706.git
cd camera-vc0706
git checkout patch-1
npm install
npm test
```