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

fix:httpcode #1252

Closed
wants to merge 1 commit into from
Closed

fix:httpcode #1252

wants to merge 1 commit into from

Conversation

constwz
Copy link
Contributor

@constwz constwz commented Nov 24, 2023

Description

add a description of your changes here...

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Potential Impacts

  • add potential impacts for other components here
  • ...

@@ -43,6 +46,23 @@ func init() {
})
}

func GetGfSpErr(err error) *GfSpError {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if the passed-in err is already a GfSpError?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added type assertions

if len(err.Error())-1 < i+6 {
return nil
}
errInfo := err.Error()[i+6:]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does [i+6:] fit all cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The result after the rpc call is "rpc error: code = Unknown desc = xxx" We only focus on xxx

@constwz constwz closed this Nov 27, 2023
@constwz constwz deleted the fix-httpcode branch November 27, 2023 07:55
@constwz constwz restored the fix-httpcode branch November 27, 2023 07:55
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