From 8db6964dc5dd7620b4ca56af2e308523d772afb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 8 Dec 2016 17:49:47 +0100 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0c875baadb..22856dba1d 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,14 @@ const options = { } // Launch nuxt build with given options -// TODO: you can wrap below inside try/catch to catch any errors. -let nuxt = new Nuxt(options).build(); -// You can use nuxt.render(req, res) or nuxt.renderRoute(route, context) - +let nuxt = new Nuxt(options) +nuxt.build() +.then(() => { + // You can use nuxt.render(req, res) or nuxt.renderRoute(route, context) +}) +.catch((e) => { + // An error appended during the build +}) ```