Skip to content

Commit

Permalink
feat: add issues support in serializer and createHttpException
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Oct 28, 2023
1 parent 51f26cf commit 57e06d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/exception/.size-limit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ module.exports = [
import: "{ createHttpException }",
limit: "900B", // Will import all server/client exceptions
},

{
name: "ESM ({ toJson })",
path: ["dist/serializer/index.mjs"],
import: "{ toJson }",
limit: "805B",
limit: "950B",
},
{
name: "ESM ({ fromJson })",
Expand Down
5 changes: 2 additions & 3 deletions packages/exception/src/client/HttpUnprocessableEntity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HttpClientException } from '../base';
import type { HttpExceptionParams } from '../types/HttpExceptionParams';
import type { HttpExceptionParamsWithIssues } from '../types/HttpExceptionParamsWithIssues';
import type { HttpValidationIssue } from '../types/HttpValidationIssue';
import type { ValidationError } from '../types/ValidationError';
import { getSuperArgs, initProtoAndName } from '../utils';
Expand Down Expand Up @@ -32,9 +33,7 @@ export class HttpUnprocessableEntity extends HttpClientException {
| (HttpExceptionParams & {
/** @deprecated use issues instead */
errors?: ValidationError[];
} & {
issues?: HttpValidationIssue[];
})
} & HttpExceptionParamsWithIssues)
| string
) {
const {
Expand Down

0 comments on commit 57e06d1

Please sign in to comment.