Skip to content

Commit

Permalink
fix: miss action in decodeResultOrThrow when using TypeReference (#143)
Browse files Browse the repository at this point in the history
* fix: miss action in decodeResultOrThrow when using TypeReference

* docs: version upgrade
  • Loading branch information
devxb authored Jul 7, 2024
1 parent de3a1a2 commit a11eb05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<br>

![version 0.4.4](https://img.shields.io/badge/version-0.4.4--beta--1-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square)
![version 0.4.5](https://img.shields.io/badge/version-0.4.5-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square)
![redis--stream](https://img.shields.io/badge/-redis--stream-da2020?style=flat-square&logo=Redis&logoColor=white)

**TPS(6,000)** on my Macbook air m2(default options). _[link](#Test1-TPS)_
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official

### Project ###
group=org.rooftopmsa
version=0.4.4-beta-1
version=0.4.5
compatibility=17

### Sonarcloud ###
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/org/rooftop/netx/api/Result.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ class Result<T : Any> private constructor(
* @param typeReference
* @return T result of saga
*/
fun decodeResultOrThrow(typeReference: TypeReference<T>): T = decodeResult(typeReference)
fun decodeResultOrThrow(typeReference: TypeReference<T>): T {
if (!isSuccess) {
throwError()
}
return decodeResult(typeReference)
}

/**
* @see decodeResultOrThrow
Expand Down

0 comments on commit a11eb05

Please sign in to comment.