referrerpolicy=no-referrer-when-downgrade

polkadot_node_collation_generation/
error.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Polkadot.
3
4// Polkadot is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Polkadot is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Polkadot.  If not, see <http://www.gnu.org/licenses/>.
16
17use polkadot_primitives::CommittedCandidateReceiptError;
18use thiserror::Error;
19
20#[derive(Debug, Error)]
21pub enum Error {
22	#[error(transparent)]
23	Subsystem(#[from] polkadot_node_subsystem::SubsystemError),
24	#[error(transparent)]
25	OneshotRecv(#[from] futures::channel::oneshot::Canceled),
26	#[error(transparent)]
27	Runtime(#[from] polkadot_node_subsystem::errors::RuntimeApiError),
28	#[error(transparent)]
29	Util(#[from] polkadot_node_subsystem_util::Error),
30	#[error(transparent)]
31	UtilRuntime(#[from] polkadot_node_subsystem_util::runtime::Error),
32	#[error(transparent)]
33	Erasure(#[from] polkadot_erasure_coding::Error),
34	#[error("Collation submitted before initialization")]
35	SubmittedBeforeInit,
36	#[error("V2 core index check failed: {0}")]
37	CandidateReceiptCheck(CommittedCandidateReceiptError),
38	#[error("PoV size {0} exceeded maximum size of {1}")]
39	POVSizeExceeded(usize, usize),
40}
41
42pub type Result<T> = std::result::Result<T, Error>;