Skip to content

Commit

Permalink
fix: remove try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasalfiti authored and nitin-vavdiya committed May 14, 2024
1 parent 02b1f5a commit b840c77
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eclipse.tractusx.managedidentitywallets.exception.WalletNotFoundProblem;
import org.eclipse.tractusx.managedidentitywallets.utils.CommonUtils;
import org.eclipse.tractusx.managedidentitywallets.utils.Validate;
import org.eclipse.tractusx.ssi.lib.exception.did.DidParseException;
import org.eclipse.tractusx.ssi.lib.model.verifiable.credential.VerifiableCredential;
import org.springframework.stereotype.Service;

Expand All @@ -54,12 +55,7 @@ public Wallet getWalletByIdentifier(String identifier) {
if (CommonUtils.getIdentifierType(identifier).equals(StringPool.BPN)) {
wallet = walletRepository.getByBpn(identifier);
} else {
try {
wallet = walletRepository.getByDid(identifier);
} catch (Exception e) {
log.error("Error while parsing did {}", StringEscapeUtils.escapeJava(identifier), e);
throw new WalletNotFoundProblem("Error while parsing did " + identifier);
}
wallet = walletRepository.getByDid(identifier);
}
Validate.isNull(wallet).launch(new WalletNotFoundProblem("Wallet not found for identifier " + identifier));
return wallet;
Expand Down

0 comments on commit b840c77

Please sign in to comment.