Created
December 8, 2019 21:48
-
-
Save mrcampbell/09b0cf30f7f3bc5b8b09e31fa65aa66c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createUser(name, age, address) { | |
try { | |
validateUser({name, age, address}) | |
} catch (err) { | |
throw Error("User is not valid") | |
} | |
// insert into database, then return result | |
return db.insertUser({name, age, address}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment