mirror of https://github.com/grpc/grpc.git
parent
ec49866463
commit
cbeff627d6
6 changed files with 59 additions and 26 deletions
@ -0,0 +1,40 @@ |
||||
# Copyright 2023 The gRPC Authors |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
class BaseError(Exception): |
||||
""" |
||||
The base class for exceptions generated by gRPC. |
||||
""" |
||||
|
||||
class UsageError(BaseError): |
||||
""" |
||||
Raised when the usage of API by applications is inappropriate. |
||||
|
||||
For example, trying to invoke RPC on a closed channel, mixing two styles |
||||
of streaming API on the client side. This exception should not be |
||||
suppressed. |
||||
""" |
||||
|
||||
class AbortError(BaseError): |
||||
""" |
||||
Raised when calling abort in servicer methods. |
||||
|
||||
This exception should not be suppressed. Applications may catch it to |
||||
perform certain clean-up logic, and then re-raise it. |
||||
""" |
||||
|
||||
class InternalError(BaseError): |
||||
""" |
||||
Raised upon unexpected errors in native code. |
||||
""" |
Loading…
Reference in new issue