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

fix: Wallet Management Error Handling #1248

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

CryptoKnightIOG
Copy link
Contributor

Copy link
Contributor

github-actions bot commented Jul 4, 2024

Integration Test Results

18 files  ±0  18 suites  ±0   2s ⏱️ ±0s
39 tests ±0  39 ✅ ±0  0 💤 ±0  0 ❌ ±0 
64 runs  ±0  64 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 35f7b9e. ± Comparison against base commit 823057a.

Copy link
Contributor

github-actions bot commented Jul 4, 2024

Unit Test Results

 96 files  ±0   96 suites  ±0   21m 45s ⏱️ - 1m 14s
826 tests ±0  818 ✅ ±0  8 💤 ±0  0 ❌ ±0 
833 runs  ±0  825 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit 35f7b9e. ± Comparison against base commit 823057a.

@CryptoKnightIOG CryptoKnightIOG added autoupdate Merge the main branch into a feature branch and removed autoupdate Merge the main branch into a feature branch labels Jul 4, 2024
@CryptoKnightIOG CryptoKnightIOG enabled auto-merge (squash) July 4, 2024 14:31
Copy link
Contributor

@bvoiturier bvoiturier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT but it would be good to have @patlo-iog's review as well IMO 💪

case class PermissionNotAvailable(userId: UUID, cause: String)
extends PermissionManagementServiceError(StatusCode.BadRequest, cause)

case class ServiceError(cause: String) extends PermissionManagementServiceError(StatusCode.InternalServerError, cause)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this one represents the catch-all "unexpected error" case, right? From the caller's perspective, there is no way to recover from this type of failure, so I would remove it and throw a defect in the service implementation instead.

)
.asSome
.catchSome { case e: RuntimeException =>
if (e.getMessage().contains("Could not find resource")) ZIO.none
if (e.getMessage.contains("Could not find resource")) ZIO.none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patlo-iog Just a side comment, but this looks rather fragile... 🧐

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. It's a shame library we use don't expose information about resource not found 🥲, but I can recheck.

@CryptoKnightIOG CryptoKnightIOG merged commit cfd5101 into main Jul 5, 2024
14 checks passed
@CryptoKnightIOG CryptoKnightIOG deleted the ATL-6838-Wallet-Management branch July 5, 2024 10:00
@patlo-iog
Copy link
Contributor

Late to the party, but LGTM

Copy link
Contributor

@FabioPinheiro FabioPinheiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

hyperledger-bot added a commit that referenced this pull request Jul 15, 2024
# [1.38.0](cloud-agent-v1.37.0...cloud-agent-v1.38.0) (2024-07-15)

### Bug Fixes

* Move InMemory classes to the test moduels ([#1240](#1240)) ([823057a](823057a))
* move mocks into the test modules ([#1236](#1236)) ([df83026](df83026))
* use Put and Get for DID in doobie statement ([#1250](#1250)) ([fc1cf51](fc1cf51))
* Wallet Management Error Handling ([#1248](#1248)) ([cfd5101](cfd5101))

### Features

* upgrade docusaurus and semantic-release packages ([de53f1d](de53f1d))

Signed-off-by: Allain Magyar <[email protected]>
shotexa pushed a commit that referenced this pull request Jul 17, 2024
Signed-off-by: Bassam Riman <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
shotexa pushed a commit that referenced this pull request Jul 17, 2024
# [1.38.0](cloud-agent-v1.37.0...cloud-agent-v1.38.0) (2024-07-15)

### Bug Fixes

* Move InMemory classes to the test moduels ([#1240](#1240)) ([823057a](823057a))
* move mocks into the test modules ([#1236](#1236)) ([df83026](df83026))
* use Put and Get for DID in doobie statement ([#1250](#1250)) ([fc1cf51](fc1cf51))
* Wallet Management Error Handling ([#1248](#1248)) ([cfd5101](cfd5101))

### Features

* upgrade docusaurus and semantic-release packages ([de53f1d](de53f1d))

Signed-off-by: Allain Magyar <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants