Integration Server 10.15 | Built-In Services Reference Guide | gRPC Folder | Summary of Elements in This Folder | pub.grpc.observer:onError
 
pub.grpc.observer:onError
WmGRPC. Notifies the gRPC client about an unsuccessful gRPC request caused by an error that occurred during the gRPC request processing performed by the gRPC method flow service.
Input Parameters
streamObserver
Object A gRPC object used by the gRPC server to return the response to the gRPC client.
status
String The gRPC error code to be returned. The codes correspond to status codes defined by gRPC.io minus the prefix “GRPC_STATUS_”. Set status to one of the following:
*ABORTED
*ALREADY_EXISTS
*CANCELLED
*DATA_LOSS
*DEADLINE_EXCEEDED
*FAILED_PRECONDITION
*INTERNAL
*INVALID_ARGUMENT
*NOT_FOUND
*OK
*OUT_OF_RANGE
*PERMISSION_DENIED
*RESOURCE_EXHAUSTED
*UNAVAILABLE
*UNAUTHENTICATED
*UNIMPLEMENTED
*UNKNOWN
message
String Message text to be returned with the gRPC error, including any specific error details you want to return to the gRPC client.
Output Parameters
None.
Usage Notes
An instance of the streamObserver is present in the pipeline when any gRPC method flow service is invoked by the gRPC server. It is an opaque object to be used only as input to the pub.grpc.observer:onNext, pub.grpc.observer:onCompleted, or pub.grpc.observer:onError services.
For unary methods, the gRPC method flow service automatically generated for a gRPC descriptor contains the calls to the pub.grpc.observer:onNext and pub.grpc.observer:onCompleted services. When implementing the logic for the RPC method in the RPC method flow service, you can modify the gRPC method flow service to include logic to return a gRPC error by adding an INVOKE step for the pub.grpc.observer:onError service. If you modify the gRPC method flow service to return an error or return a response message, make sure the flow logic ensures that either pub.grpc.observer:onError executes or pub.grpc.observer:onNext and pub.grpc.observer:onCompleted execute. This can be accomplished by using a BRANCH step. Further, the flow service logic must terminate immediately after executing pub.grpc.observer:onError.