Skip to content

Instantly share code, notes, and snippets.

@bewarusman
Created February 5, 2019 06:51
Show Gist options
  • Save bewarusman/161fca8412dd1b28be4b621cf689e589 to your computer and use it in GitHub Desktop.
Save bewarusman/161fca8412dd1b28be4b621cf689e589 to your computer and use it in GitHub Desktop.
var createTodo = async (req, res, next) => {
try {
var text = req.body.text;
if(!text) {
var err = new Error('todo should be provided');
err.msg = 'todo should be provided';
err.status = 406;
next(err);
return;
}
} catch(err) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment