Generate constants for error codes and expose them in bindings
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 1.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 126
Description
The errors returned from FDB are currently defined in [error_definitions.h](https://github.com/apple/foundationdb/blob/master/flow/error_definitions.h). This means that the error codes are only really exposed within FDB internally, so users who want to do things like do different things with different errors have to do things like hard code the error codes within them. (It also means that if the bindings want to generate an error with a built-in type (like the go bindings do if the API version is in an incorrect range), then they also have to hard code the error.) It would be nice if we could generate constants for the different error codes so that the users could reference by an in-built constant.
The other thing we could do with this is generate the error code documentation page automatically from it.
Contributor guide
Research direction
Start with flow/error_definitions.h and trace how error codes are consumed by the language bindings, including the Go binding path mentioned in the issue. Determine how generated constants should be exposed to binding users and whether the error-code documentation can use the same source. Done means supported bindings expose built-in error constants without hard-coded values and the documentation page is generated if that scope is included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, go
- Domain
- api, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100