restatedev / sdk-typescript

Restate SDK for JavaScript/Typescript
MIT License
46 stars 8 forks source link

Expose HttpCallError in restate-sdk-clients #395

Closed mupperton closed 3 months ago

mupperton commented 3 months ago

To enable usage in userland such as

import { HttpCallError } from '@restatedev/restate-sdk-clients'

try {
  // Send request
} catch (error) {
  if (error instanceof HttpCallError) {
    // Type narrowed error, now access properties such as `status`
  }
}