👾Errors

To know the error response from Startrail-Sdk-Js

Description

Errors inheriting from Error objects will be thrown, and custom error properties are described in the Response below

See more details for Error objects

Response

VariableTypeDescription

from

"StartrailSdk"

To identify where the error comes from

errorCode

ErrorCode

To identify the error type for error handling

ErrorCode

Followings are the errors to be returned. Frontend can catch and handle it accordingly for better UX.

AUTH0_VERIFY_EMAIL

What:

Immediately after signup is submitted with Email Password by a user, this error is thrown.

Action to take:

You can customize the UI/UX to align with your project's specific plans and requirements. How you choose to handle this customization depends on the unique needs of your project.

METADATA_VALIDATION_FAILED

What:

Metadata validation fails duet to schema validation.

Action to take:

Revise the metadata object itself based on the error message.

STARTRAIL_API_ERROR

What:

Error occurs in StartrailAPI.

Action to take:

Check error message to identify the content.

TORUS_USER_REJECT_WALLET_REQUEST

What:

The user closes the confirmation popup presented for signing.

Action to take:

You can customize the UI/UX to align with your project's specific plans and requirements. How you choose to handle this customization depends on the unique needs of your project.

WALLET_NOT_INITIALIZED

What:

After logging out from the SDK, the wallet instance becomes undefined.

Action to take:

Call new Startrail() once again in your web-application.

WALLET_NOT_SUPPORTED

What:

Unsupported wallet is called. (Official MetaMask library calls Coinbase Wallet browser extension when it is activated)

Action to take:

Request end-users to switch your wallet.

WALLET_EOA_NOT_MATCH

What:

It is not possible to prevent end-users from switching their EOA on Metamask even after logging in, which can potentially lead to a scenario where the EOA used for signing, e.g., for issuing SRR, is different from the one they initially logged into the web application.

When

When SDK calls StartrailAPI

Action to take:

Request to switch back to the EOA with which the user originally logged in.

WALLET_NOT_FOUND

What:

The wallet does not open because it has not been activated (unlocked) in your browser extension.

Action to take:

Request end-users to activate or unlock your wallet.

WALLET_NOT_SUPPORT_FUNCTION

What:

Some functions are not supported for particular wallets. eg. overwriteConfig() or switchLanguage() are not supported in Metamask.

Action to take:

It depends on frontend developers

Response Example

Example

{
	from: 'StartrailSdk',
	errorCode: 'TORUS_USER_REJECT_WALLET_REQUEST',
	message: 'Torus Message Signature: User denied message signature.',

}

Last updated

©2023 Startbahn, Inc.