Skip to content

Commit 238e0d0

Browse files
kthuirmccorm4
andauthored
Add docs for error code (triton-inference-server#300)
* Add docs for error code * Describe default behavior Co-authored-by: Ryan McCormick <[email protected]> * Python format code block Co-authored-by: Ryan McCormick <[email protected]> --------- Co-authored-by: Ryan McCormick <[email protected]>
1 parent 193de67 commit 238e0d0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,23 @@ class TritonPythonModel:
485485
return responses
486486
```
487487

488+
Starting from 23.09, `pb_utils.TritonError` may be constructed with an optional
489+
Triton error code on the second parameter. For example:
490+
491+
```python
492+
pb_utils.TritonError("The file is not found", pb_utils.TritonError.NOT_FOUND)
493+
```
494+
495+
If no code is specified, `pb_utils.TritonError.INTERNAL` will be used by default.
496+
497+
Supported error codes:
498+
* `pb_utils.TritonError.UNKNOWN`
499+
* `pb_utils.TritonError.INTERNAL`
500+
* `pb_utils.TritonError.NOT_FOUND`
501+
* `pb_utils.TritonError.INVALID_ARG`
502+
* `pb_utils.TritonError.UNAVAILABLE`
503+
* `pb_utils.TritonError.UNSUPPORTED`
504+
* `pb_utils.TritonError.ALREADY_EXISTS`
488505

489506
#### Decoupled mode
490507

0 commit comments

Comments
 (0)