Skip to content

Conversation

@lnbc1QWFyb24
Copy link
Collaborator

This PR adds a new parameter to the initialization object: onerror. This will get passed on to the SDK so that all errors that return from the server will get passed on to the function that is added on init. This will allow devs to handle rate limit errors in particular, allowing them to decide whether to remove notifications or add a custom notification indicating the error.

src/notify.ts Outdated
blocknative = new BlocknativeSdk({
dappId,
networkId,
onerror: appOptions.onerror,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronbarnardsound is there a reason that you didn't de-structure this along with the rest of the appOptions above? e.g.

const { dappId, networkId, name, clientLocale, onerror } = appOptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call, I have updated to de-structuring

@lnbc1QWFyb24 lnbc1QWFyb24 changed the base branch from master to develop June 9, 2021 00:52
@lnbc1QWFyb24 lnbc1QWFyb24 merged commit 7474448 into develop Jun 9, 2021
@lnbc1QWFyb24 lnbc1QWFyb24 deleted the enhancement/error-handler branch June 9, 2021 00:53
@lnbc1QWFyb24
Copy link
Collaborator Author

Closes #193

@taylorjdawson taylorjdawson mentioned this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants