-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathGrpcErrorInfoProvider.java
More file actions
41 lines (35 loc) · 1.01 KB
/
GrpcErrorInfoProvider.java
File metadata and controls
41 lines (35 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package io.vertx.grpc.server;
import io.vertx.core.MultiMap;
import io.vertx.grpc.common.GrpcStatus;
/**
* Interface for providing detailed error information in gRPC server responses.
* <p>
* Implementing this interface allows exceptions to expose structured gRPC error details,
* including a status a descriptive error message, and optional trailers.
* </p>
* <p>
* This design enables custom exceptions to propagate meaningful and rich error context to gRPC clients
* without coupling to a specific exception class.
* </p>
*/
public interface GrpcErrorInfoProvider {
/**
* Returns the GrpcStatus associated with this error.
*
* @return the gRPC status
*/
GrpcStatus status();
/**
* Returns the gRPC error message to send to the client.
*
* @return the error message as a string
*/
String message();
/**
* Returns optional key-value trailers to include in the response.
* Can be {@code null} or empty.
*
* @return containing error trailers
*/
MultiMap trailers();
}