Update error handling [issue 97]
@@ -34,7 +34,7 @@ func NewBook(c *fiber.Ctx) error {
db := database.DBConn
book := new(Book)
if err := c.BodyParser(book); err != nil {
- return c.Status(503).SendString(err)
+ return c.Status(503).SendString(err.Error())
}
db.Create(&book)
return c.JSON(book)
