@@ -154,7 +154,7 @@ function generateSEA(fixtureDir, options = {}) {
154154 } catch ( e ) {
155155 const message = `Cannot copy ${ process . execPath } to ${ outputFile } : ${ inspect ( e ) } ` ;
156156 if ( verifyWorkflow ) {
157- throw new Error ( message ) ;
157+ throw new Error ( message , { cause : e } ) ;
158158 }
159159 common . skip ( message ) ;
160160 }
@@ -192,7 +192,7 @@ function generateSEA(fixtureDir, options = {}) {
192192 } catch ( e ) {
193193 const message = `Cannot inject ${ seaPrepBlob } into ${ outputFile } : ${ inspect ( e ) } ` ;
194194 if ( verifyWorkflow ) {
195- throw new Error ( message ) ;
195+ throw new Error ( message , { cause : e } ) ;
196196 }
197197 common . skip ( message ) ;
198198 }
@@ -210,7 +210,7 @@ function signSEA(targetExecutable, verifyWorkflow = false) {
210210 } catch ( e ) {
211211 const message = `Cannot sign ${ targetExecutable } : ${ inspect ( e ) } ` ;
212212 if ( verifyWorkflow ) {
213- throw new Error ( message ) ;
213+ throw new Error ( message , { cause : e } ) ;
214214 }
215215 common . skip ( message ) ;
216216 }
@@ -221,7 +221,7 @@ function signSEA(targetExecutable, verifyWorkflow = false) {
221221 } catch ( e ) {
222222 const message = `Cannot find signtool: ${ inspect ( e ) } ` ;
223223 if ( verifyWorkflow ) {
224- throw new Error ( message ) ;
224+ throw new Error ( message , { cause : e } ) ;
225225 }
226226 common . skip ( message ) ;
227227 }
@@ -232,7 +232,7 @@ function signSEA(targetExecutable, verifyWorkflow = false) {
232232 } catch ( e ) {
233233 const message = `Cannot sign ${ targetExecutable } : ${ inspect ( e ) } \n${ stderr } ` ;
234234 if ( verifyWorkflow ) {
235- throw new Error ( message ) ;
235+ throw new Error ( message , { cause : e } ) ;
236236 }
237237 common . skip ( message ) ;
238238 }
0 commit comments