<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>idea Experience Builder Automated Deployment should throw an error when ZipApp fails in ArcGIS Experience Builder Ideas</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-ideas/experience-builder-automated-deployment-should/idi-p/1598844</link>
    <description>&lt;P&gt;For reference, see the &lt;A href="https://developers.arcgis.com/experience-builder/guide/deployment-topics/#automated-deployments" target="_self"&gt;Automated Deployment guidance documentation&lt;/A&gt;. In it, we're instructed to run&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip', 'my_client_id');"&lt;/LI-CODE&gt;&lt;P&gt;to download our zip.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works well enough in the ideal case. However, when zipApp fails we are left with nothing but error messages in stderr to indicate the failure.&amp;nbsp;It would be helpful for our automated systems if zipApp would either: (1) exit with a non-zero exit code (2) return a non-zero number or (3), throw an error we can catch via try/catch.&lt;/P&gt;&lt;P&gt;My preference would be on #1 so we can easily check the error code in shells like cmd/PowerShell/bash.&lt;/P&gt;&lt;P&gt;I have a workaround in PowerShell that's rather ugly (↴). If a non-zero exit-code were returned I could simply call the function as described in the docs and the build would fail appropriately.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;$ErrorActionPreference = $Stop
$PSNativeCommandUseErrorActionPreference = $true

if (Test-Path err.txt) { Remove-Item err.txt -Force }

node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', '$AppZip', '$ClientId');" 2&amp;gt;err.txt
    
$err = Get-Content err.txt -Raw
if ($err.Length -gt 0) {
    Write-Host "ZipApp failed with an unhandled exception ↴"
    throw $err
}&lt;/LI-CODE&gt;&lt;P&gt;If others have found cleaner solutions, I would love to hear them.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2025 12:06:06 GMT</pubDate>
    <dc:creator>RyanTaylor</dc:creator>
    <dc:date>2025-03-25T12:06:06Z</dc:date>
    <item>
      <title>Experience Builder Automated Deployment should throw an error when ZipApp fails</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-ideas/experience-builder-automated-deployment-should/idi-p/1598844</link>
      <description>&lt;P&gt;For reference, see the &lt;A href="https://developers.arcgis.com/experience-builder/guide/deployment-topics/#automated-deployments" target="_self"&gt;Automated Deployment guidance documentation&lt;/A&gt;. In it, we're instructed to run&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip', 'my_client_id');"&lt;/LI-CODE&gt;&lt;P&gt;to download our zip.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works well enough in the ideal case. However, when zipApp fails we are left with nothing but error messages in stderr to indicate the failure.&amp;nbsp;It would be helpful for our automated systems if zipApp would either: (1) exit with a non-zero exit code (2) return a non-zero number or (3), throw an error we can catch via try/catch.&lt;/P&gt;&lt;P&gt;My preference would be on #1 so we can easily check the error code in shells like cmd/PowerShell/bash.&lt;/P&gt;&lt;P&gt;I have a workaround in PowerShell that's rather ugly (↴). If a non-zero exit-code were returned I could simply call the function as described in the docs and the build would fail appropriately.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;$ErrorActionPreference = $Stop
$PSNativeCommandUseErrorActionPreference = $true

if (Test-Path err.txt) { Remove-Item err.txt -Force }

node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', '$AppZip', '$ClientId');" 2&amp;gt;err.txt
    
$err = Get-Content err.txt -Raw
if ($err.Length -gt 0) {
    Write-Host "ZipApp failed with an unhandled exception ↴"
    throw $err
}&lt;/LI-CODE&gt;&lt;P&gt;If others have found cleaner solutions, I would love to hear them.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 12:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-ideas/experience-builder-automated-deployment-should/idi-p/1598844</guid>
      <dc:creator>RyanTaylor</dc:creator>
      <dc:date>2025-03-25T12:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Experience Builder Automated Deployment should throw an error when ZipApp fails</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-ideas/experience-builder-automated-deployment-should/idc-p/1599346#M3858</link>
      <description>&lt;P&gt;Thanks for your post! We will consider adding more detailed error messages and will keep you updated.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 09:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-ideas/experience-builder-automated-deployment-should/idc-p/1599346#M3858</guid>
      <dc:creator>TianWen</dc:creator>
      <dc:date>2025-03-26T09:22:24Z</dc:date>
    </item>
  </channel>
</rss>

