Skip to content

Commit 12c1bd7

Browse files
ejaniacopybara-github
authored andcommitted
Add GitHub links to documentation where necessary.
PiperOrigin-RevId: 713741671 Change-Id: I1cab0f20b0361c2d9126c35f4bd404098038f809
1 parent 156babb commit 12c1bd7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/error_message.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,26 @@ When error happens,
3939
`AssembleErrorMessage` when the additional context is available.
4040

4141
2. In the topmost CPython layer, the
42-
`SetKodaPyErrFromStatus` C++
42+
[`SetKodaPyErrFromStatus`](https://github.com/google/koladata/blob/main//py/koladata/exceptions/py_exception_utils.h)
43+
C++
4344
function checks if the `Status` contains the specific error proto. If so, it
4445
passes the serialized proto to python side. The python counter part
4546
deserializes the proto, creates the `KodaError` python exception instance,
4647
stores the proto in the exception and returns the instance to C++. Finally
4748
the `SetKodaPyErrFromStatus` raises the
48-
`KodaError` exception in Python then
49+
[`KodaError`](https://github.com/google/koladata/blob/main//py/koladata/exceptions/exceptions.py)
4950
finishes the process.
5051

5152
## Implementation Steps
5253

5354
### Check existing error categories
5455

5556
There's already a list of error categories in
56-
`//koladata/internal/error.proto`
57+
[error.proto](https://github.com/google/koladata/blob/main//koladata/internal/error.proto).
5758

5859
Check if the case to improve is already covered. If so, create the error proto
5960
instance when error is happening and attaches to the `Status`.
60-
example in `//koladata/data_slice.cc`
61+
See [example](https://github.com/google/koladata/blob/main//koladata/data_slice.cc).
6162

6263
### Define the specific error proto type
6364

@@ -67,11 +68,11 @@ necessary fields to the proto, create an error proto instance and attach it to
6768

6869
### Modify `AssembleErrorMessage`
6970

70-
Then
71-
change `AssembleErrorMessag`, in `//koladata/repr_utils.cc`,
71+
Then in
72+
[AssembleErrorMessage](https://github.com/google/koladata/blob/main//koladata/repr_utils.cc),
7273
create a new branch to handle the category. In the `Status` propagation path,
7374
call `AssmebleErrorMessage` to update the error message. The
74-
`SupplementalData`
75+
[`SupplementalData`](https://github.com/google/koladata/blob/main//koladata/repr_utils.h)
7576
structure can be used to carry the additional context for assembling the
7677
message.
7778

@@ -99,7 +100,7 @@ When updating the error message during the
99100
`Status` propagation path, creates a new `KodaError` proto and moves the
100101
original error proto to the `cause` field. The final `KodaError` python
101102
exception instance will have the corresponding cause. See
102-
`CreateItemCreationError` in `//koladata/repr_utils.cc`
103+
[CreateItemCreationError](https://github.com/google/koladata/blob/main//koladata/repr_utils.h)
103104
and its call site.
104105

105106
## Current limitations and future improvement

0 commit comments

Comments
 (0)