Skip to content

Instantly share code, notes, and snippets.

@fengmk2
Created December 27, 2011 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fengmk2/1523070 to your computer and use it in GitHub Desktop.
Save fengmk2/1523070 to your computer and use it in GitHub Desktop.
Find bug in code
Foo.prototype.get = function(key, callback) {
db.get(key, function(err, data) {
if (err) return callback(err);
try {
callback(null, JSON.parse(data.toString());
} catch(e) {
callback(e);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment