Skip to content

Releases: webrpc/gen-typescript

v0.15.1

04 Nov 10:12
1c8a5e1

Choose a tag to compare

What's Changed

Full Changelog: v0.15.0...v0.15.1

v0.15.0

22 Oct 08:56
dffc0ff

Choose a tag to compare

What's Changed

Full Changelog: v0.14.1...v0.15.0

v0.14.1

02 Oct 13:28
27fa214

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.0...v0.14.1

v0.14.0: Fix SSE timeout bug

02 Oct 13:24
ca8157b

Choose a tag to compare

What's Changed

Full Changelog: v0.13.0...v0.14.0

v0.13.0: Expose as Go module

04 Apr 14:59
2f1daf9

Choose a tag to compare

Merge pull request #16 from webrpc/gomod

Expose as a Go module with //go:embed FS

v0.12.0

28 Jul 14:55
38f5b96

Choose a tag to compare

  • Backport AbortSignal feature from cohere.ai #9
  • Add check for error type #8

v0.11.2

19 Jul 10:56
f50891a

Choose a tag to compare

Fixes webrpc/webrpc#205

By @kolberg-dev.

v0.11.1

23 Mar 21:58
c9ed0dd

Choose a tag to compare

Return WebrpcRequestFailedError on net::ERR_CONNECTION_REFUSED.

v0.11.0 schema errors

23 Mar 11:53
a807898

Choose a tag to compare

See full webrpc@v0.11.0 release.

Note: Schema errors are implemented on client side only for now. TODO: Server side support.

typescript@v0.11.0 breaking client changes

  • All errors thrown by webrpc client are now instance of WebrpcError, which extends JavaScript Error. No need to re-throw errors anymore.
  • error.msg error.message
  • by default, the error messages are "human-friendly", they don't contain any details about the backend error cause
  • underlying backend error (for developers) is optionally available as error.cause?
  • error.code or error.message can be used as input for user-friendly error i18n translations

You can now check for explicit error class instance (as defined in RIDL schema) or against a generic WebrpcError class.

try {
  const resp = await testApiClient.getUser();
  // setUser(resp.user)
} catch (error) {
  if (error instanceof RateLimitedError) {
    // retry with back-off time
  }
  
  if (error instanceof UnauthorizedError) {
    // render sign-in page
  }
  
  if (error instanceof WebrpcError) {
    console.log(error.status) // print response HTTP status code (ie. 4xx or 5xx)
    console.log(error.code) // print unique schema error code; generic endpoint errors are 0
    console.log(error.message) // print error message
    console.log(error.cause) // print the underlying backend error -- ie. "DB error" - useful for debugging / reporting to Sentry
  }
  
  // setError(error.message)
}

v0.10.0: Interoperability tests

02 Jan 16:17
87775b4

Choose a tag to compare