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

Implement AOS-47: Additional Error Specification #558

Closed
11 tasks done
xxchan opened this issue May 7, 2021 · 2 comments · Fixed by beyondstorage/site#70
Closed
11 tasks done

Implement AOS-47: Additional Error Specification #558

xxchan opened this issue May 7, 2021 · 2 comments · Fixed by beyondstorage/site#70
Assignees
Projects
Milestone

Comments

@xxchan
Copy link
Contributor

xxchan commented May 7, 2021

rendered proposal

implement AOS-51 together beyondstorage/specs#51

go-service-*:

first update dependency: go get -d github.com/aos-dev/go-storage/v3@master

AOS-47:

  • Turn ad-hoc string errors into defined errors: check rg "(fmt.Errorf)|errors\.New"
  • Turn SDK errors into fmt.Errorf("%w, %v", services.ErrUnexpected, err)
  • Return error structs instead of pointers:
    • rg -l "Error" | xargs sed -i 's/&\(.*\)Error/\1Error/g'
    • rg -l "Error" | xargs sed -i 's/New\(.*\)Error(\(.*\))/\1Error{\2}/g'
  • Check naming convention

AOS-51:

  • use errorCode : rg -l "errors\.New" | xargs sed -i 's/errors\.New/services.NewErrorCode/g'
  • check AosError in formatError: add this
	if _, ok := err.(services.AosError); ok {
		return err
	}
  • add formatError in InitError's Err field:
    • update newServicerAndStorager
    • rg -l InitError | xargs sed -i 's/InitError\(.*\)Err: err/InitError\1Err: formatError(err)/g'

  • azblob
  • cos
  • dropbox
  • fs
  • gcs
  • kodo
  • oss
  • qingstor
  • s3
  • uss
@Xuanwo
Copy link
Contributor

Xuanwo commented May 10, 2021

@Xuanwo
Copy link
Contributor

Xuanwo commented May 12, 2021

Let's add a doc about error handling in go-storage? Tell the user what's our design and how could they use it.

go-storage automation moved this from In progress to Done May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants