5htp-core 0.6.0-93 → 0.6.0-94

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.6.0-93",
4
+ "version": "0.6.0-94",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  import type express from 'express';
15
15
  import type { Request, Response, NextFunction } from 'express';
16
16
  import { v4 as uuid } from 'uuid';
17
- import zod from 'zod';
17
+ import zod, { ZodError } from 'zod';
18
18
  export { default as schema } from 'zod';
19
19
  import type { GlobImportedWithMetas } from 'babel-plugin-glob-import';
20
20
 
@@ -23,7 +23,7 @@ import type { Application } from '@server/app';
23
23
  import Service, { AnyService, TServiceArgs } from '@server/app/service';
24
24
  import context from '@server/context';
25
25
  import type DisksManager from '@server/services/disks';
26
- import { CoreError, NotFound, toJson as errorToJson } from '@common/errors';
26
+ import { CoreError, InputError, NotFound, toJson as errorToJson } from '@common/errors';
27
27
  import BaseRouter, {
28
28
  TRoute, TErrorRoute, TRouteModule,
29
29
  TRouteOptions, defaultOptions,
@@ -615,7 +615,12 @@ export default class ServerRouter
615
615
  request.res.json(responseData);
616
616
  }
617
617
 
618
- private async handleError( e: CoreError, request: ServerRequest<ServerRouter> ) {
618
+ private async handleError( e: Error |CoreError | ZodError, request: ServerRequest<ServerRouter> ) {
619
+
620
+ if (e instanceof ZodError)
621
+ e = new InputError(
622
+ e.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')
623
+ );
619
624
 
620
625
  const code = 'http' in e ? e.http : 500;
621
626
 
package/types/icons.d.ts CHANGED
@@ -1 +1 @@
1
- export type TIcones = "times"|"solid/spinner-third"|"long-arrow-right"|"check-circle"|"coins"|"building"|"at"|"phone"|"bolt"|"brands/linkedin"|"rocket"|"user-circle"|"chart-bar"|"crosshairs"|"plane-departure"|"plus-circle"|"comments-alt"|"arrow-right"|"user-shield"|"shield-alt"|"chart-line"|"money-bill-wave"|"star"|"link"|"file-alt"|"long-arrow-left"|"calendar-alt"|"paper-plane"|"search"|"lightbulb"|"magnet"|"sun"|"brands/whatsapp"|"user-plus"|"sack-dollar"|"info-circle"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"user"|"solid/crown"|"eye"|"pen"|"plus"|"file"|"envelope"|"angle-up"|"angle-down"|"clock"|"cog"|"trash"|"ellipsis-h"|"check"|"binoculars"|"pencil"|"regular/shield-check"|"download"|"exclamation-circle"|"times-circle"|"meh-rolling-eyes"|"arrow-left"|"bars"|"solid/star"|"solid/star-half-alt"|"regular/star"|"chevron-left"|"power-off"|"question-circle"|"wind"|"users"|"bug"|"play"|"minus-circle"|"external-link"|"brands/google"|"arrow-to-bottom"|"broom"|"map-marker-alt"|"solid/check-circle"|"solid/exclamation-triangle"|"solid/times-circle"|"hourglass"|"exclamation-triangle"|"minus"|"plug"|"solid/magic"|"briefcase"|"map-marker"|"fire"|"coin"|"globe"|"comment-alt"|"magic"|"industry"|"calendar"|"graduation-cap"|"bold"|"italic"|"underline"|"strikethrough"|"subscript"|"superscript"|"code"|"unlink"|"font"|"empty-set"|"horizontal-rule"|"page-break"|"image"|"table"|"poll"|"columns"|"sticky-note"|"caret-right"|"align-left"|"align-center"|"align-right"|"align-justify"|"indent"|"outdent"|"list-ul"|"check-square"|"h1"|"h2"|"h3"|"h4"|"list-ol"|"paragraph"|"quote-left"
1
+ export type TIcones = "long-arrow-right"|"times"|"solid/spinner-third"|"check-circle"|"coins"|"building"|"at"|"phone"|"bolt"|"brands/linkedin"|"rocket"|"chart-bar"|"user-circle"|"plane-departure"|"plus-circle"|"comments-alt"|"arrow-right"|"crosshairs"|"user-shield"|"shield-alt"|"chart-line"|"money-bill-wave"|"star"|"link"|"file-alt"|"long-arrow-left"|"calendar-alt"|"paper-plane"|"user-plus"|"magnet"|"sack-dollar"|"info-circle"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"user"|"sun"|"brands/whatsapp"|"search"|"lightbulb"|"angle-up"|"angle-down"|"solid/crown"|"eye"|"pen"|"plus"|"file"|"envelope"|"clock"|"cog"|"trash"|"ellipsis-h"|"check"|"pencil"|"regular/shield-check"|"binoculars"|"download"|"exclamation-circle"|"times-circle"|"arrow-left"|"meh-rolling-eyes"|"bars"|"solid/star"|"solid/star-half-alt"|"regular/star"|"chevron-left"|"power-off"|"external-link"|"question-circle"|"play"|"minus-circle"|"wind"|"users"|"bug"|"map-marker-alt"|"arrow-to-bottom"|"broom"|"brands/google"|"solid/check-circle"|"solid/exclamation-triangle"|"solid/times-circle"|"hourglass"|"exclamation-triangle"|"minus"|"plug"|"comment-alt"|"coin"|"briefcase"|"map-marker"|"fire"|"solid/magic"|"industry"|"calendar"|"globe"|"magic"|"graduation-cap"|"code"|"bold"|"italic"|"underline"|"font"|"strikethrough"|"subscript"|"superscript"|"empty-set"|"horizontal-rule"|"page-break"|"image"|"table"|"poll"|"columns"|"sticky-note"|"caret-right"|"unlink"|"align-left"|"align-center"|"align-right"|"align-justify"|"indent"|"outdent"|"list-ul"|"check-square"|"h1"|"h2"|"h3"|"h4"|"list-ol"|"paragraph"|"quote-left"