Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure every route is caught by onError when using the provisioning API #465

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

Half-Shot
Copy link
Contributor

No description provided.

Copy link
Contributor

@justinbot justinbot left a comment

Choose a reason for hiding this comment

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

Looks good, just a note on how this affects existing usages.

@@ -236,7 +236,8 @@ export class ProvisioningApi {
// Pass to error handler.
next([ex, provisioningRequest]);
}
});
// Always add an error handler
}, this.onError);
Copy link
Contributor

@justinbot justinbot Mar 27, 2023

Choose a reason for hiding this comment

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

Just noting this will supersede any error handling implementation in the sublcass
e.g. https://github.com/matrix-org/matrix-appservice-irc/blob/develop/src/provisioning/Provisioner.ts#L144-L158

(Actually looking again I suppose it wouldn't since that wrapper goes before this error handler?)

I suppose the idea is you would now override onError instead?

Copy link
Contributor Author

@Half-Shot Half-Shot Mar 27, 2023

Choose a reason for hiding this comment

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

Yeah, that's certainly one way. Or you could wrap your handler in a try/catch and just not emit an error. The onError code was always intended to catch errors that fell through routes.

@Half-Shot Half-Shot merged commit 8de1c2e into develop Apr 12, 2023
@Half-Shot Half-Shot deleted the hs/add-error-handler branch May 2, 2023 16:07
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.

2 participants