Slide 16
Slide 16 text
```
if isProfileExists(profileID) {
// can annotate errors with error codes
return nil, apperrors.WithStatusCode(
apperrors.New("profile does not exist"),
http.StatusNotFound,
)
}
result, err := conn.Exec("INSERT INTO ...", profileID, company)
if err != nil {
// can annotate unexpected errors
return nil, apperrors.WithReport(
apperrors.WithMessage(err, "failed to write new working history"),
)
}
```
16