Skip to content

Commit

Permalink
better error report on save fail
Browse files Browse the repository at this point in the history
  • Loading branch information
yourcelf committed Apr 11, 2012
1 parent 6895340 commit ce956c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assets/js/frontend.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ class ds.EditIdea extends Backbone.View
success: (model) ->
ds.app.navigate "/d/#{ds.model.get("slug")}/show/#{model.id}", trigger: true
error: (model, err) ->
flash "error", "Error saving: #{err}"
console.error(err)
str = if err.error? then err.error else err
flash "error", "Error saving: #{str}"
}
return false

Expand Down
1 change: 0 additions & 1 deletion lib/backbone-mongo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Backbone.sync = (method, model, options) ->
else
Model = models.modelFromCollectionName(collectionName)
newModel = new Model(result[0])
logger.debug "emit after:#{method}:#{model.collectionName}"
cb(newModel)

if model.id? or options.query?._id?
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ jasmine-node
mongodb
markdown
canvas
node-uuid

0 comments on commit ce956c4

Please sign in to comment.