netlify / ask-netlify

A place to submit questions for Netlify to answer in tutorials, podcasts and blog posts
https://ask.netlify.com
32 stars 8 forks source link

Build not failing on node process error? #71

Open leomp12 opened 4 years ago

leomp12 commented 4 years ago

About me

My question in a little more detail

I'm deploying an EJS based template, this template uses axios and some of the request promises haven't rejection handlers intentionally, because if it fails I just want to exit the process with failure.

In a recent build it fires the following error:

11:10:15 AM: Error: /opt/build/repo/template/pages/#categories.ejs:26
11:10:15 AM:     24|       <%- await include('@custom-html/categories/append-top', { _ }) %>
11:10:15 AM:     25|
11:10:15 AM:  >> 26|       <%- await include(`@/views/categories`, { _ }) %>
11:10:15 AM:     27|
11:10:15 AM:     28|       <%- await include('@custom-html/append-bottom', { _ }) %>
11:10:15 AM:     29|       <%- await include('@custom-html/categories/append-bottom', { _ }) %>
11:10:15 AM: /opt/build/repo/template/pages/@/views/categories.ejs:62
11:10:15 AM:     60|     <div class="cat container py-1 py-sm-2 py-lg-4">
11:10:15 AM:     61|       <% if (Array.isArray(pageCategories.showcase) && pageCategories.showcase.length) { %>
11:10:15 AM:  >> 62|         <%
11:10:15 AM:     63|         for (let i = 0; i < pageCategories.showcase.length; i++) {
11:10:15 AM:     64|           const shelf = pageCategories.showcase[i]
11:10:15 AM:     65|           // get collection body
11:10:15 AM: read ECONNRESET

Then it stops deploying the template, but the build process successfully ended anyway, why? The site was published without many pages because the deployment was interrupted :disappointed:

Shouldn't the build have failed? :thinking:

leomp12 commented 4 years ago

Do I need to call process.exit(1) explicitly? Would it work?