diff --git a/cli/src/bundle/zip.ts b/cli/src/bundle/zip.ts index 84ef4e904c..5a8d6e7667 100644 --- a/cli/src/bundle/zip.ts +++ b/cli/src/bundle/zip.ts @@ -7,6 +7,7 @@ import { parse } from '@std/semver' import { trackEvent } from '../analytics/track' import { checkAlerts } from '../api/update' import { getChecksum } from '../checksum' +import { CliUserError } from '../shared/cli-user-error' import { baseKeyV2, findRoot, @@ -62,7 +63,7 @@ export async function zipBundleInternal(appId: string, options: BundleZipOptions else log.error(message) } - throw new Error('Invalid bundle version format') + throw new CliUserError('Invalid bundle version format') } path = path || extConfig?.config?.webDir @@ -75,7 +76,7 @@ export async function zipBundleInternal(appId: string, options: BundleZipOptions else log.error(message) } - throw new Error(message) + throw new CliUserError(message) } if (shouldShowPrompts) @@ -92,7 +93,7 @@ export async function zipBundleInternal(appId: string, options: BundleZipOptions else log.error('notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready') } - throw new Error('notifyAppReady() is missing in build folder') + throw new CliUserError('notifyAppReady() is missing in build folder') } const foundIndex = checkIndexPosition(path) @@ -103,7 +104,7 @@ export async function zipBundleInternal(appId: string, options: BundleZipOptions else log.error(`index.html is missing in the root folder of ${path}`) } - throw new Error('index.html is missing in root folder') + throw new CliUserError('index.html is missing in root folder') } } @@ -123,7 +124,7 @@ export async function zipBundleInternal(appId: string, options: BundleZipOptions const warning = 'Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager' if (!silent) log.warn(warning) - throw new Error(warning) + throw new CliUserError(warning) } let useSha256 = false