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

sdk should provide some common way to check specific error #88

Open
wanliqun opened this issue Jun 22, 2021 · 0 comments
Open

sdk should provide some common way to check specific error #88

wanliqun opened this issue Jun 22, 2021 · 0 comments

Comments

@wanliqun
Copy link
Collaborator

As @boqiu metioned in https://github.com/Conflux-Dev/conflux-infura/pull/69#discussion_r655829246, sdk should provide some common way for client application to check if the return error is some specific error.

        epochReceipts, err := cfx.GetEpochReceiptsByPivotBlockHash(pivotHash)
	if err != nil {
		errStr := strings.ToLower(err.Error())

		// pivot hash assumption failed, must be pivot switched
		if strings.Contains(errStr, "pivot assumption failed") || strings.Contains(errStr, "block not found") {
                      // handle pivot switch
                 }
         }

This issue is urgent, and is blocking infura && scan, please take a look and discuss about it.

@Pana @wangdayong228

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

No branches or pull requests

1 participant