Skip to content

Releases: belgattitude/httpx

@httpx/assert@0.1.0

Choose a tag to compare

@belgattitude belgattitude released this 27 Dec 16:56
10bf974

Minor Changes

@httpx/json-api@0.5.7

Choose a tag to compare

@belgattitude belgattitude released this 26 Dec 17:28
502d3c5

Patch Changes

@httpx/exception@2.6.0

Choose a tag to compare

@belgattitude belgattitude released this 26 Dec 17:28
502d3c5

Minor Changes

  • #815 77cd15b Thanks @belgattitude! - Deprecate the type HttpStatusCode, use HttpErrorStatusCode instead

    HttpErrorStatusCode is less ambiguous ad HttpStatusCode could be understood
    as HttpStatusCode could represent all http statuses. The type is exported
    but there's very few chances an regular user would be impacted.

  • #815 77cd15b Thanks @belgattitude! - Add new types: HttpErrorStatusCode and HttpErrorStatusCodeOrNumber

    Improves the typescript experience by allowing typescript to suggest assigned
    status codes in createException and HttpException, HttpClientException,
    HttpServerException constructors. Arbitray numbers can still be used.

  • #815 77cd15b Thanks @belgattitude! - Add new typeguards: isErrorWithErrorStatusCode and isObjectWithErrorStatusCode

    Those typeguards can be used in specific circumstances when an originating
    error has a statusCode field which indicates by convention the preferred status
    to send.

    import {
      isErrorWithErrorStatusCode,
      createHttpException,
    } from "@httpx/exception";
    
    try {
      throw new (class extends Error {
        statusCode = 400;
      })();
    } catch (e) {
      if (isErrorWithErrorStatusCode(e)) {
        throw createException(e.statusCode, "Something wrong happened");
      }
    }
    const noSuchUser = {
      statusCode: 404,
    } satisfies ObjectWithStatusCode;
    
    class NoSuchItem extends DomainError implements ObjectWithStatusCode {
      statusCode: 404;
    }
    
    if (isObjectWithErrorStatusCode(noSuchUser)) {
      throw createException(e.statusCode, "Nothing");
    }

@httpx/json-api@0.5.6

Choose a tag to compare

@belgattitude belgattitude released this 13 Dec 21:09
05335ad

Patch Changes

prisma-exception@0.0.1

Choose a tag to compare

prisma-exception

@httpx/json-api@0.5.5

Choose a tag to compare

@belgattitude belgattitude released this 09 Dec 17:10
c8eb3ab

Patch Changes

  • Updated dependencies [b004243]:
    • @httpx/exception@2.5.7

@httpx/json-api@0.5.4

Choose a tag to compare

@belgattitude belgattitude released this 09 Dec 16:44
a01b607

Patch Changes

  • Updated dependencies [39ec1d5]:
    • @httpx/exception@2.5.6

@httpx/json-api@0.5.3

Choose a tag to compare

@belgattitude belgattitude released this 09 Dec 13:13
11ba671

Patch Changes

  • Updated dependencies [4e2b795]:
    • @httpx/exception@2.5.5

@httpx/exception@2.5.7

Choose a tag to compare

@belgattitude belgattitude released this 09 Dec 17:10
c8eb3ab

Patch Changes

@httpx/exception@2.5.6

Choose a tag to compare

@belgattitude belgattitude released this 09 Dec 16:44
a01b607

Patch Changes