Skip to content

Commit

Permalink
Update python_component.md
Browse files Browse the repository at this point in the history
  • Loading branch information
klalit committed Jun 26, 2019
1 parent 9a8cd1d commit 5eceb70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/source/python/python_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,10 @@ If you want more control you can provide a low-level methods that will provide a

## User Defined Exceptions
If you want to handle custom exceptions define a field `model_error_handler` as shown below:

```
model_error_handler = flask.Blueprint('error_handlers', __name__)
```
An example is as follow:

```
class MyModel(Object):
Expand All @@ -191,7 +189,9 @@ An example is as follow:
def predict(self, X, features_names, **kwargs):
raise UserCustomException('Test-Error-Msg',1402,402)
return X
```
> Custom User Excpetion
```
class UserCustomException(Exception):
status_code = 404
Expand Down

0 comments on commit 5eceb70

Please sign in to comment.