cockroachdb / cockroachdb/errors

Add ability to wrap an error with an Unimplemented error

Đang mở
#86 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
2.5k
Fork
74
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have a bit of code that does something like this:
```
errors.UnimplementedErrorf(
link,
"unsupported expression %q: %v",
exprString,
err,
)
```

This flattens the `err` argument. What I'd really like is something like

```
errors.UnimplementedWrapf(
err,
link,
"unsupported expression %q",
exprString,
)
```

(analogous to `errors.Errorf` versus `errors.Wrapf`)

The exact piece of code I'm referring to is: https://github.com/cockroachdb/cockroach/blob/7bf398fc9c715e67ae4ab342569b26f50809fb59/pkg/ccl/importccl/read_import_mysql.go#L764

cc @knz

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start with the referenced call in pkg/ccl/importccl/read_import_mysql.go around line 764, then compare the existing UnimplementedErrorf and Wrapf APIs. Add the requested UnimplementedWrapf behavior so the original error remains wrapped while the message includes the supplied expression text; verify it with focused error-formatting tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go
Lĩnh vực
backend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.