You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Polaris currently expects anchors to raise various built-in exception classes when calling integration class functions. For example, Polaris expects DepositIntegration.process_sep6_request() to raise a ValueError if the client's request is invalid in some way that Polaris itself cannot validate.
There are two reasons why this is not ideal:
Built-in exceptions could be unintentionally raised as a result of a bug in the anchor's implementation.
Polaris may treat these exceptions as proper behavior if the raised exception is expected for a specific error case.
Polaris isn't able to disambiguate error cases that use the same built-in exception class.
For example, if an anchor raises a RuntimeError from CustodyIntegration.create_destination_account(), it could be because the source account doesn't exist or it could be because transaction submission failed, and Polaris cannot currently determine which is the case
Instead, Polaris should use custom exceptions that inherit from built-ins, just like the Python SDK does. Anchors will be required to update their implementations to raise the correct exceptions, so we'll have to wait until v3.0 to implement this for existing integrations.
That being said, we could add custom built-in exceptions for new integrations, such the CustodyIntegration class that currently being developed.
The text was updated successfully, but these errors were encountered:
Polaris currently expects anchors to raise various built-in exception classes when calling integration class functions. For example, Polaris expects
DepositIntegration.process_sep6_request()
to raise aValueError
if the client's request is invalid in some way that Polaris itself cannot validate.There are two reasons why this is not ideal:
RuntimeError
fromCustodyIntegration.create_destination_account()
, it could be because the source account doesn't exist or it could be because transaction submission failed, and Polaris cannot currently determine which is the caseInstead, Polaris should use custom exceptions that inherit from built-ins, just like the Python SDK does. Anchors will be required to update their implementations to raise the correct exceptions, so we'll have to wait until v3.0 to implement this for existing integrations.
That being said, we could add custom built-in exceptions for new integrations, such the
CustodyIntegration
class that currently being developed.The text was updated successfully, but these errors were encountered: