不要怂,就是干,撸起袖子干!

Commit 634205a2 by Sascha Depold

added error handling to documentation

1 parent 5817c532
Showing with 14 additions and 0 deletions
......@@ -73,6 +73,12 @@ As you are able to specify an objects _skeleton_, the next step is to push it to
Project.drop(callback)
Task.drop(callback)
// with error handling:
Project.[sync|drop](function(table, error) {
if(error) // oooh, did you entered wrong database credentials?
else // ok ... everything is nice!
})
Because synchronizing and dropping all of your tables might be a lot of line to write, you can also let Sequelize do the work for you:
// create all tables... now!
......@@ -81,6 +87,12 @@ Because synchronizing and dropping all of your tables might be a lot of line to
// and drop it!
sequelize.drop(callback)
// with error handling:
sequelize.[sync|drop](function(errors) {
if(errors.length > 0) // whooops
else // woot woot
})
## Creating and working with instances ##
In order to create instances of defined classes just do it as follows:
......
......@@ -38,3 +38,4 @@
# 0.3.1 #
- added error handling when defining invalid database credentials
- Sequelize#sync, Sequelize#drop, model#sync, model#drop returns errors via callback
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!