Skip to content

Export errors classes #212

@cctidal

Description

@cctidal

It would be useful to be able to check if an errors comes from pusher by checking against the pusher error classes.

Proposed:

import Pusher, { PusherRequestError, PusherWebHookError } from 'pusher'

const pusher = new Pusher(/*...*/)

try {
  // more code
  pusher.trigger(/*...*/)
  // more code
} catch(error) {
  if (error instanceof PusherRequestError || error instanceof PusherWebHookError) {
    // handle pusher error
  }
  throw error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions