generated from okp4/template-rust
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cognitarium): add store limits related errors
- Loading branch information
Showing
1 changed file
with
31 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
use cosmwasm_std::StdError; | ||
use cosmwasm_std::{StdError, Uint128}; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug, PartialEq)] | ||
pub enum ContractError { | ||
#[error("{0}")] | ||
Std(#[from] StdError), | ||
|
||
#[error("{0}")] | ||
Store(#[from] StoreError), | ||
|
||
#[error("Only the owner can perform this operation.")] | ||
Unauthorized {}, | ||
|
||
#[error("Not implemented.")] | ||
NotImplemented, | ||
} | ||
|
||
#[derive(Error, Debug, PartialEq)] | ||
pub enum StoreError { | ||
#[error("Maximum triples number exceeded: {0}")] | ||
MaxTriplesLimitExceeded(Uint128), | ||
|
||
#[error("Maximum byte size exceeded: {0}")] | ||
MaxByteSize(Uint128), | ||
|
||
#[error("Maximum triple byte size exceeded: {0} / {1}")] | ||
MaxTripleByteSize(Uint128, Uint128), | ||
|
||
#[error("Maximum query limit exceeded: {0} / {1}")] | ||
MaxQueryLimit(Uint128, Uint128), | ||
|
||
#[error("Maximum query variable count exceeded: {0} / {1}")] | ||
MaxQueryVariableCount(Uint128, Uint128), | ||
|
||
#[error("Maximum insert byte size exceeded: {0}")] | ||
MaxInsertDataByteSize(Uint128), | ||
|
||
#[error("Maximum insert triple count exceeded: {0}")] | ||
MaxInsertDataTripleCount(Uint128), | ||
} |