• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-building-blocks / 8205627138

08 Mar 2024 03:41PM UTC coverage: 30.873%. First build
8205627138

Pull #922

shotexa
Formatting

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
Pull Request #922: feat(pollux): send revocation notification to the holder

1 of 94 new or added lines in 8 files covered. (1.06%)

4334 of 14038 relevant lines covered (30.87%)

0.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/model/error/CredentialServiceError.scala
1
package io.iohk.atala.pollux.core.model.error
2

3
import io.iohk.atala.pollux.core.model.DidCommID
4
import io.iohk.atala.pollux.vc.jwt.W3cCredentialPayload
5

6
import java.util.UUID
7

NEW
8
sealed trait CredentialServiceError {
×
NEW
9
  def toThrowable: Throwable = this match
×
NEW
10
    case CredentialServiceError.RepositoryError(cause)     => cause
×
NEW
11
    case CredentialServiceError.LinkSecretError(cause)     => cause
×
NEW
12
    case CredentialServiceError.RecordIdNotFound(recordId) => new Throwable(s"RecordId not found: $recordId")
×
NEW
13
    case CredentialServiceError.OperationNotExecuted(recordId, info) =>
×
NEW
14
      new Throwable(s"Operation not executed for recordId: $recordId, info: $info")
×
NEW
15
    case CredentialServiceError.ThreadIdNotFound(thid)     => new Throwable(s"ThreadId not found: $thid")
×
NEW
16
    case CredentialServiceError.InvalidFlowStateError(msg) => new Throwable(s"Invalid flow state: $msg")
×
NEW
17
    case CredentialServiceError.UnexpectedError(msg)       => new Throwable(s"Unexpected error: $msg")
×
NEW
18
    case CredentialServiceError.UnsupportedDidFormat(did)  => new Throwable(s"Unsupported DID format: $did")
×
NEW
19
    case CredentialServiceError.UnsupportedCredentialFormat(vcFormat) =>
×
NEW
20
      new Throwable(s"Unsupported credential format: $vcFormat")
×
NEW
21
    case CredentialServiceError.MissingCredentialFormat => new Throwable("Missing credential format")
×
NEW
22
    case CredentialServiceError.CreateCredentialPayloadFromRecordError(cause) => cause
×
NEW
23
    case CredentialServiceError.CredentialRequestValidationError(error) =>
×
NEW
24
      new Throwable(s"Credential request validation error: $error")
×
NEW
25
    case CredentialServiceError.CredentialIdNotDefined(credential) =>
×
NEW
26
      new Throwable(s"CredentialId not defined for credential: $credential")
×
NEW
27
    case CredentialServiceError.CredentialSchemaError(cause) =>
×
NEW
28
      new Throwable(s"Credential schema error: ${cause.message}")
×
NEW
29
    case CredentialServiceError.UnsupportedVCClaimsValue(error) => new Throwable(s"Unsupported VC claims value: $error")
×
NEW
30
    case CredentialServiceError.UnsupportedVCClaimsMediaType(media_type) =>
×
NEW
31
      new Throwable(s"Unsupported VC claims media type: $media_type")
×
NEW
32
    case CredentialServiceError.CredentialDefinitionPrivatePartNotFound(credentialDefinitionId) =>
×
NEW
33
      new Throwable(s"Credential definition private part not found: $credentialDefinitionId")
×
34
    case CredentialServiceError.CredentialDefinitionIdUndefined => new Throwable("Credential definition id undefined")
35
}
36

37
object CredentialServiceError {
38
  final case class RepositoryError(cause: Throwable) extends CredentialServiceError
39

40
  final case class LinkSecretError(cause: Throwable) extends CredentialServiceError
41
  final case class RecordIdNotFound(recordId: DidCommID) extends CredentialServiceError
42
  final case class OperationNotExecuted(recordId: DidCommID, info: String) extends CredentialServiceError
43
  final case class ThreadIdNotFound(thid: DidCommID) extends CredentialServiceError
44
  final case class InvalidFlowStateError(msg: String) extends CredentialServiceError
45
  final case class UnexpectedError(msg: String) extends CredentialServiceError
46
  final case class UnsupportedDidFormat(did: String) extends CredentialServiceError
47
  final case class UnsupportedCredentialFormat(vcFormat: String) extends CredentialServiceError
48
  object MissingCredentialFormat extends CredentialServiceError
49
  final case class CreateCredentialPayloadFromRecordError(cause: Throwable) extends CredentialServiceError
50
  final case class CredentialRequestValidationError(error: String) extends CredentialServiceError
51
  final case class CredentialIdNotDefined(credential: W3cCredentialPayload) extends CredentialServiceError
52
  final case class CredentialSchemaError(cause: io.iohk.atala.pollux.core.model.error.CredentialSchemaError)
53
      extends CredentialServiceError
54
  final case class UnsupportedVCClaimsValue(error: String) extends CredentialServiceError
55
  final case class UnsupportedVCClaimsMediaType(media_type: String) extends CredentialServiceError
56
  final case class CredentialDefinitionPrivatePartNotFound(credentialDefinitionId: UUID) extends CredentialServiceError
57
  case object CredentialDefinitionIdUndefined extends CredentialServiceError
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc