Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.6 error display #320

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 22 additions & 28 deletions pallets/audit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,55 +230,49 @@ pub mod pallet {
/// Error for the audit pallet.
#[pallet::error]
pub enum Error<T> {
//Vec to BoundedVec Error.
/// Vec to BoundedVec Error
BoundedVecError,
//Error that the storage has reached the upper LIMIT.
/// Error indicating that the storage has reached its limit
StorageLimitReached,

/// Data overflow
Overflow,
//The miner submits a certificate, but there is no error in the challenge list
/// The miner submits a certificate, but there is no error in the challenge list
NoChallenge,
//Not a consensus node or not registered
/// Not a consensus node or not registered
ScheduleNonExistent,
//The certificate does not exist or the certificate is not verified by this dispatcher
NonProof,
//filetype error
/// filetype error
FileTypeError,
//The user does not have permission to call this method
/// The user does not have permission to call this method
NotQualified,
//Error recording time
/// Error recording time
RecordTimeError,

/// Offchain worker: Error Signing the transaction
OffchainSignedTxError,

/// There is no local account that can be used for signing
NoLocalAcctForSigning,

/// Length exceeds limit
LengthExceedsLimit,

Locked,

/// An error that will not occur by design will be prompted after an error occurs during the random number generation process
SystemError,

/// The verification task does not exist
NonExistentMission,

/// Unexpected Error
UnexpectedError,

/// Challenge has expired
Expired,

/// Verification of tee signature failed
VerifyTeeSigFailed,

/// Bloom filter validation failed
BloomFilterError,

/// The certificate has been submitted and cannot be submitted again
Submitted,

Challenging,

/// Random number generation failed
RandomErr,

/// No proof submitted
UnSubmitted,

/// The tee does not have permission
TeeNoPermission,

/// Signature format conversion failed
MalformedSignature,
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/cacher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T> {
//Registered Error
/// Already registered Error
AlreadyRegistered,
//Unregistered Error
/// Error Registration Required
UnRegistered,
//Option parse Error
/// Option parse Error
OptionParseError,
}

Expand Down
1 change: 1 addition & 0 deletions pallets/cess-treasury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T> {
/// Data operation overflow
Overflow,
}

Expand Down
70 changes: 31 additions & 39 deletions pallets/file-bank/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,75 +197,67 @@ pub mod pallet {
#[pallet::error]
pub enum Error<T> {
Existed,

/// File already exists
FileExistent,
//file doesn't exist.
/// file doesn't exist
FileNonExistent,
//overflow.
/// Data operation overflow
Overflow,

/// Not the owner of the file
NotOwner,

NotQualified,
//It is not an error message for scheduling operation
/// It is not an error message for scheduling operation
ScheduleNonExistent,
//Error reporting when boundedvec is converted to VEC
/// Error reporting when boundedvec is converted to VEC
BoundedVecError,
//Error that the storage has reached the upper limit.
/// Error indicating that the storage has reached its limit
StorageLimitReached,
//The miner's calculation power is insufficient, resulting in an error that cannot be
// replaced
/// The miner's calculation power is insufficient, resulting in an error that cannot be replaced
MinerPowerInsufficient,

/// The bucket is not empty
NotEmpty,
//Multi consensus query restriction of off chain workers
/// Multi consensus query restriction of off chain workers
Locked,

/// Length exceeds limit, maximum of 42 bytes
LengthExceedsLimit,

Declarated,

/// Some operations that should not have errors
BugInvalid,

/// Error encountered when converting Hash
ConvertHashError,
//No operation permission
/// No operation permission. Perhaps it was not authorized
NoPermission,
//user had same name bucket
/// User had same name bucket
SameBucketName,
//Bucket, file, and scheduling errors do not exist
/// Bucket, file, and scheduling errors do not exist
NonExistent,
//Unexpected error
/// Logically speaking, errors that should not occur
Unexpected,
//Less than minimum length
/// Less than minimum length
LessMinLength,
//The file is in an unprepared state
/// The file is in an unprepared state
Unprepared,
//Transfer target acc already have this file
/// Transfer target acc already have this file
IsOwned,
//The file does not meet the specification
/// The file does not meet the specification
SpecError,

NodesInsufficient,
// This is a bug that is reported only when the most undesirable
// situation occurs during a transaction execution process.
/// This is a bug that is reported only when the most undesirable situation occurs during a transaction execution process
PanicOverflow,

/// The user currently has insufficient available storage space
InsufficientAvailableSpace,
// The file is in a calculated tag state and cannot be deleted
/// The file is in a calculated tag state and cannot be deleted
Calculate,

/// Miners need to be in a positive state
MinerStateError,

/// The deadline for restoring files has expired
Expired,

/// Failed to verify the signature of tee
VerifyTeeSigFailed,

/// The type of tee does not have permission to execute this function
TeeNoPermission,

/// Validation digest error during file tag calculation process
DigestError,

/// Error converting tee signature
MalformedSignature,

/// Error in comparing miner account information
MinerError,
}

Expand Down
12 changes: 6 additions & 6 deletions pallets/oss/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T> {
//No errors authorizing any use
/// No errors authorizing any use
NoAuthorization,
//Registered Error
/// Registered Error
Registered,
//Unregistered Error
/// Unregistered Error
UnRegister,
//Option parse Error
/// Option parse Error
OptionParseError,
//Bounded Vector Error
/// Convert bounded vector Error
BoundedVecError,
//Already Exists Error
/// Already Exists Error
Existed,
}

Expand Down
3 changes: 2 additions & 1 deletion pallets/scheduler-credit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T> {
/// Data operation overflow
Overflow,

/// Data operation overflow
PointOverflow,
}

Expand Down
42 changes: 17 additions & 25 deletions pallets/sminer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,47 +196,39 @@ pub mod pallet {
LessThan24Hours,
/// Numerical conversion error.
ConversionError,
//The account has been frozen
/// The account has been frozen
AlreadyFrozen,

LockInNotOver,

/// The miner is not in a positive state and cannot perform this operation
NotpositiveState,

/// The capacity of Vec has reached the upper limit, making it impossible to register new miners. In theory, this error should not occur
StorageLimitReached,

/// Convert bounded vec error
BoundedVecError,

/// The recording error of the faucet does not occur under normal circumstances
DataNotExist,
//haven't bought space at all
NotPurchasedPackage,

/// According to business logic, errors that should not occur
Unexpected,

NoReward,

/// Verify tee signature error
VerifyTeeSigFailed,

/// Count error in spatial proof related data
CountError,

LowerOperationBlock,

/// The status of the miner cannot call the current transaction
StateError,

/// Bloom filter update error
BloomElemPushError,

/// Insufficient pledged amount
CollateralNotUp,

/// Not the pledgor
NotStakingAcc,

/// System method errors that should not occur
BugInvalid,

/// The pledge period is insufficient and needs to reach 180 days
InsufficientStakingPeriod,

/// The certified space exceeds the declared space
ExceedingDeclarationSpace,

/// Insufficient idle space for replacement
InsufficientReplaceable,

/// Conversion tee signature error
MalformedSignature,
}

Expand Down
29 changes: 15 additions & 14 deletions pallets/storage-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,34 +104,35 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T> {
/// System method errors that should not occur
BugInvalid,

/// Convert bounded vec error
BoundedVecError,

/// Insufficient available space on the network, unable to purchase
InsufficientAvailableSpace,
// Balance not enough
/// Balance not enough
InsufficientBalance,

/// The user currently has insufficient available space
InsufficientStorage,

/// Data operation overflow
Overflow,

/// Wrong operator input, can only be 1 or 2
WrongOperation,

/// Space has already been purchased and cannot be purchased again
PurchasedSpace,

/// Space not purchased, please purchase space first before calling this transaction
NotPurchasedSpace,
// storage space frozen
/// Storage space frozen
LeaseFreeze,

/// Space has expired
LeaseExpired,

/// Order has expired
OrderExpired,

/// Random number generation error1
RandomErr,

/// There is no such order
NoOrder,

/// Parameter error, please check the parameters. The expiration time cannot exceed one hour
ParamError,
}

Expand Down
Loading
Loading