mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 22:41:02 +00:00
use thiserror instead of derive_more for error handling (#10696)
* use thiserror instead of derive_more for error handling Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Update utils/prometheus/src/lib.rs * Update utils/prometheus/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -16,21 +16,21 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#[derive(derive_more::Display, derive_more::From)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
/// Top-level error type for the RPC handler
|
||||
pub enum Error {
|
||||
/// The GRANDPA RPC endpoint is not ready.
|
||||
#[display(fmt = "GRANDPA RPC endpoint not ready")]
|
||||
#[error("GRANDPA RPC endpoint not ready")]
|
||||
EndpointNotReady,
|
||||
/// GRANDPA reports the authority set id to be larger than 32-bits.
|
||||
#[display(fmt = "GRANDPA reports authority set id unreasonably large")]
|
||||
#[error("GRANDPA reports authority set id unreasonably large")]
|
||||
AuthoritySetIdReportedAsUnreasonablyLarge,
|
||||
/// GRANDPA reports voter state with round id or weights larger than 32-bits.
|
||||
#[display(fmt = "GRANDPA reports voter state as unreasonably large")]
|
||||
#[error("GRANDPA reports voter state as unreasonably large")]
|
||||
VoterStateReportsUnreasonablyLargeNumbers,
|
||||
/// GRANDPA prove finality failed.
|
||||
#[display(fmt = "GRANDPA prove finality rpc failed: {}", _0)]
|
||||
ProveFinalityFailed(sc_finality_grandpa::FinalityProofError),
|
||||
#[error("GRANDPA prove finality rpc failed: {0}")]
|
||||
ProveFinalityFailed(#[from] sc_finality_grandpa::FinalityProofError),
|
||||
}
|
||||
|
||||
/// The error codes returned by jsonrpc.
|
||||
|
||||
Reference in New Issue
Block a user