Last active
August 24, 2023 11:34
-
-
Save akihisa-shimada/1b29941a7a4c17d37b10d6486db7ac72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.proto.grpc.exception.message; | |
import com.google.protobuf.Message; | |
import io.grpc.Status; | |
import java.util.LinkedHashMap; | |
import java.util.Objects; | |
/** | |
* 特定のgRPCレスポンスのための例外クラスです。 | |
* | |
* @see org.springframework.web.server.ResponseStatusException | |
*/ | |
public class ResponseStatusException extends RuntimeException { | |
final Status status; | |
LinkedHashMap<String, Object[]> details; | |
public ResponseStatusException(Status status, String message) { | |
super(message); | |
this.status = status; | |
this.details = null; | |
} | |
public ResponseStatusException(Status status, String message, Throwable cause) { | |
super(message, cause); | |
this.status = status; | |
this.details = null; | |
} | |
public ResponseStatusException(Status status, String message, LinkedHashMap<String, Object[]> details) { | |
super(message); | |
this.status = status; | |
this.details = details; | |
} | |
public Status getStatus() { | |
return status; | |
} | |
public LinkedHashMap<String, Object[]> getDetails() { | |
return details; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment