Add Error Code
Developmentadd-error-codeAdd Error Code is an Agent Skill for development published in the google/boringssl repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
How to add a new error code in BoringSSL.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/google/boringssl/blob/HEAD/agents/skills/add_error_code/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/add-error-code, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Adding a New Error Code
To add a new error code, you only need to use it in the source code and then run the error generation script. The script will automatically define it in the header and update the error database.
Steps
-
Use the Error Code:
- Use the new error code directly in your C/C++ source file (e.g.,
EVP_R_NEW_ERROR_CODE). It must start with the correct library prefix (e.g.,EVP_R_,SSL_R_).
- Use the new error code directly in your C/C++ source file (e.g.,
-
Run the Error Generator:
- Run util/make_errors.go, passing the lowercase library name (e.g.,
evp,ssl). - Example:
go run util/make_errors.go evp - The script will automatically:
- Find the new error code in the source.
- Assign it a numeric value.
- Add the
#defineto the appropriate header in include/openssl. - Update the
.errordatafile in crypto/err.
- Run util/make_errors.go, passing the lowercase library name (e.g.,