Skip to content

Commit a1b5698

Browse files
committed
Rethrow functions esbuild errors
1 parent fe089c6 commit a1b5698

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/app/src/cli/services/build/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ export async function buildFunctionExtension(
186186
await touchFile(bundlePath)
187187
await writeFile(bundlePath, base64Contents)
188188
}
189-
} catch (error) {
189+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
190+
} catch (error: any) {
191+
const errors = error.errors ?? []
192+
// If there is an `errors` array, it's an esbuild error, re-throw it directly.
193+
if (errors.length) throw error
194+
190195
const errorMessage = (error as Error).message ?? 'Unknown error occurred'
191196
throw new AbortError('Failed to build function.', errorMessage)
192197
} finally {

0 commit comments

Comments
 (0)