Skip to content

Commit

Permalink
getting-started/bookshelf: better error messages for create book
Browse files Browse the repository at this point in the history
  • Loading branch information
broady committed Apr 27, 2016
1 parent 1bdaccd commit 6725935
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions getting-started/bookshelf/app/app.go
Expand Up @@ -230,11 +230,11 @@ func uploadFileFromForm(r *http.Request) (url string, err error) {
func createHandler(w http.ResponseWriter, r *http.Request) *appError {
book, err := bookFromForm(r)
if err != nil {
return appErrorf(err, "could not add book: %v", err)
return appErrorf(err, "could not parse book from form: %v", err)
}
id, err := bookshelf.DB.AddBook(book)
if err != nil {
return appErrorf(err, "could not add book: %v", err)
return appErrorf(err, "could not save book: %v", err)
}
go publishUpdate(id)
http.Redirect(w, r, fmt.Sprintf("/books/%d", id), http.StatusFound)
Expand Down

0 comments on commit 6725935

Please sign in to comment.