@@ -22,7 +22,7 @@ Errors handling
2222 -32000 to -32099 , Server error , Reserved for implementation-defined server-errors.
2323
2424
25- Errors can be found in :py:mod: `pjrpc.common .exceptions ` module. Having said that error handling
25+ Errors can be found in :py:mod: `pjrpc.client .exceptions ` module. Having said that error handling
2626is very simple and "pythonic-way":
2727
2828.. code-block :: python
@@ -34,23 +34,23 @@ is very simple and "pythonic-way":
3434
3535 try :
3636 result = client.proxy.sum(1 , 2 )
37- except pjrpc.MethodNotFound as e:
37+ except pjrpc.client.exceptions. MethodNotFound as e:
3838 print (e)
3939
4040
4141 Custom errors
4242-------------
4343
4444Default error list can be easily extended. All you need to create an error class inherited from
45- :py:class: `pjrpc.common .exceptions.TypedError ` and define an error code and a description message. ``pjrpc ``
45+ :py:class: `pjrpc.client .exceptions.TypedError ` and define an error code and a description message. ``pjrpc ``
4646will be automatically deserializing custom errors for you:
4747
4848.. code-block :: python
4949
5050 import pjrpc
5151 from pjrpc.client.backend import requests as pjrpc_client
5252
53- class UserNotFound (pjrpc .exc .TypedError ):
53+ class UserNotFound (pjrpc .client . exceptions .TypedError ):
5454 CODE = 1
5555 MESSAGE = ' user not found'
5656
@@ -81,7 +81,7 @@ On the server side everything is also pretty straightforward:
8181 methods = pjrpc.server.MethodRegistry()
8282
8383
84- class UserNotFound (pjrpc .exc .TypedError ):
84+ class UserNotFound (pjrpc .server . exceptions .TypedError ):
8585 CODE = 1
8686 MESSAGE = ' user not found'
8787
@@ -123,7 +123,7 @@ to set a base error class for a particular client:
123123 from pjrpc.client.backend import requests as jrpc_client
124124
125125
126- class ErrorV1 (pjrpc .exc .TypeError , base = True ):
126+ class ErrorV1 (pjrpc .client . exceptions .TypeError , base = True ):
127127 pass
128128
129129
@@ -132,7 +132,7 @@ to set a base error class for a particular client:
132132 MESSAGE = ' permission denied'
133133
134134
135- class ErrorV2 (pjrpc .exc .TypeError , base = True ):
135+ class ErrorV2 (pjrpc .client . exceptions .TypeError , base = True ):
136136 pass
137137
138138
0 commit comments