@@ -39,25 +39,26 @@ When error happens,
3939 `AssembleErrorMessage` when the additional context is available.
4040
41412 . 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
5556There' 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
5859Check if the case to improve is already covered. If so, create the error proto
5960instance 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) ,
7273create a new branch to handle the category. In the `Status` propagation path,
7374call `AssmebleErrorMessage` to update the error message. The
74- `SupplementalData`
75+ [ `SupplementalData` ](https: // github.com / google / koladata / blob / main // koladata / repr_utils.h)
7576structure can be used to carry the additional context for assembling the
7677message.
7778
@@ -99,7 +100,7 @@ When updating the error message during the
99100`Status` propagation path, creates a new `KodaError` proto and moves the
100101original error proto to the `cause` field. The final `KodaError` python
101102exception 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)
103104and its call site.
104105
105106# # Current limitations and future improvement
0 commit comments