Skip to content

Commit 1cc2276

Browse files
authored
Merge pull request #580 from CosmWasm/rm-unauthorized
Remove StdError::Unauthorized
2 parents 36ca9e7 + f6a1c2b commit 1cc2276

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## 0.12.0 (unreleased)
44

5+
**cosmwasm-std**
6+
7+
- Remove the previously deprecated `StdError::Unauthorized`. Contract specific
8+
errors should be implemented using custom error types now (see
9+
[migration guide](./MIGRATING.md) 0.10 -> 0.11).
10+
511
**cosmwasm-vm**
612

713
- Remove `Storage::range` and `StorageIterator`. The storage implementation is

packages/std/src/errors/std_error.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(deprecated)]
2-
31
use snafu::Snafu;
42

53
/// Structured error type for init, handle and query.
@@ -57,12 +55,6 @@ pub enum StdError {
5755
msg: String,
5856
backtrace: Option<snafu::Backtrace>,
5957
},
60-
#[snafu(display("Unauthorized"))]
61-
#[deprecated(
62-
since = "0.11.0",
63-
note = "All StdError cases not required by the standard library will be removed in cosmwasm-std 0.12. Please migrate to custom errors instead of using StdError."
64-
)]
65-
Unauthorized { backtrace: Option<snafu::Backtrace> },
6658
#[snafu(display("Cannot subtract {} from {}", subtrahend, minuend))]
6759
Underflow {
6860
minuend: String,
@@ -117,14 +109,6 @@ impl StdError {
117109
}
118110
.build()
119111
}
120-
121-
#[deprecated(
122-
since = "0.11.0",
123-
note = "All StdError cases not required by the standard library will be removed in cosmwasm-std 0.12. Please migrate to custom errors instead of using StdError."
124-
)]
125-
pub fn unauthorized() -> Self {
126-
Unauthorized {}.build()
127-
}
128112
}
129113

130114
/// The return type for init, handle and query. Since the error type cannot be serialized to JSON,
@@ -274,15 +258,6 @@ mod test {
274258
}
275259
}
276260

277-
#[test]
278-
fn unauthorized_works() {
279-
let error = StdError::unauthorized();
280-
match error {
281-
StdError::Unauthorized { .. } => {}
282-
_ => panic!("expect different error"),
283-
}
284-
}
285-
286261
#[test]
287262
fn implements_debug() {
288263
let error: StdError = StdError::underflow(3, 5);

0 commit comments

Comments
 (0)