diff --git a/internal/parcel.js b/internal/parcel.js
index 040c6504a068095306791cb8e4041ecbaf6c24b1..d58490175114a1f1910e653013f63f4873f16099 100644
--- a/internal/parcel.js
+++ b/internal/parcel.js
@@ -25,9 +25,9 @@ const options = {
   autoInstall: true
 };
 
-(async function() {
+((async function () {
   let configPath = process.env.CONFIG_PATH || 'config.json';
-  if(!fs.existsSync(configPath)) throw `[Error] (Mandatory) Missing ${configPath} file`;
+  if (!fs.existsSync(configPath)) throw console.error(Error(`(Mandatory) Missing ${configPath} file`));
   console.log(`Using ${configPath} config file`);
 
   let config = JSON.parse(fs.readFileSync(configPath));
@@ -68,9 +68,11 @@ const options = {
 
   const bundler = new Bundler('./src/index.pug', options);
   bundler.addAssetType('html', require.resolve('./assets.js'));
-  if(process.env.NODE_ENV !== 'production') {
+  if (process.env.NODE_ENV !== 'production') {
     await bundler.serve();
   } else {
     await bundler.bundle();
   }
-})();
\ No newline at end of file
+})()).catch((e) => {
+  process.exitCode = 1;
+});
\ No newline at end of file