galbe 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -511,7 +511,12 @@ ${fetchApiSignature}
511
511
  ...(bodyData !== undefined ? { body: bodyData } : {}),
512
512
  })
513
513
 
514
- if (${interceptorRef}) req = await ${interceptorRef}(req, command, cliArgs, cliOptions)
514
+ if (${interceptorRef}) {
515
+ try { req = await ${interceptorRef}(req, command, cliArgs, cliOptions) } catch (e: any) {
516
+ console.error(_ansi(true, '31', \`error: \${e?.message ?? e}\`))
517
+ process.exit(1)
518
+ }
519
+ }
515
520
 
516
521
  let _res: Response | undefined
517
522
  let _resClone: Response | undefined
@@ -522,7 +527,10 @@ ${fetchApiSignature}
522
527
  const elapsed = (Bun.nanoseconds() - t0) / 1_000_000
523
528
 
524
529
  if (${formatterRef}) {
525
- Bun.write(Bun.stdout, await ${formatterRef}(_res, command, cliArgs, cliOptions))
530
+ try { Bun.write(Bun.stdout, await ${formatterRef}(_res, command, cliArgs, cliOptions)) } catch (e: any) {
531
+ console.error(_ansi(true, '31', \`error: \${e?.message ?? e}\`))
532
+ process.exit(1)
533
+ }
526
534
  } else {
527
535
  if (fmt.has('s')) Bun.write(Bun.stdout, \`\${_res.status}\\n\`)
528
536
  if (fmt.has('h')) Bun.write(Bun.stdout, _fmtObject(_headersToObj(_res.headers), fmt.has('p')) + '\\n')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "galbe",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Fast, lightweight and highly customizable JavaScript web framework based on Bun",
5
5
  "author": "Pierre Caillaud M (https://github.com/pierre-cm)",
6
6
  "type": "module",