Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akihisa-shimada/215b9a4e2acd898da1aa43b813efe7a9 to your computer and use it in GitHub Desktop.
Save akihisa-shimada/215b9a4e2acd898da1aa43b813efe7a9 to your computer and use it in GitHub Desktop.
package com.example.proto.grpc.exception.message;
import io.grpc.Status;
/**
* 特定のgRPCレスポンスのための例外クラスです。
*
* @see org.springframework.web.server.ResponseStatusException
*/
public class ResponseStatusException extends RuntimeException {
final Status status;
public ResponseStatusException(Status status, String message) {
super(message);
this.status = status;
}
public ResponseStatusException(Status status, String message, Throwable cause) {
super(message, cause);
this.status = status;
}
public Status getStatus() {
return status;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment