Skip to content

proposal: Go2 error handling for error-tree #32099

Closed
@Konstantin8105

Description

@Konstantin8105

Please add into wiki Go2ErrorHandling, my proposal for error handling in error-tree. Preview:

func printSum(a, b string) error {
  // create error tree
  et := errors.New("check input data")
  errorhandling(et interface{Add(error)}){ // add type just for clearification
    x, et := strconv.Atoi(a)
    y, et := strconv.Atoi(b)
  }
  // is error-tree have errors
  if et.IsError() {
    return et
  }
  fmt.Println("result:", x + y)
  return nil
}

In detail see: Go2ErrorTree

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeProposalerror-handlingLanguage & library change proposals that are about error handling.v2An incompatible library change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions