-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip Signed-off-by: FabioPinheiro <[email protected]> wip fix tests cleanup Fix tests scalafmt one more fix and rebase remove FixmeStatusCode scalafmt cleanup
- Loading branch information
1 parent
68626ed
commit eedcaa7
Showing
42 changed files
with
350 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 30 additions & 5 deletions
35
.../server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobError.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
package org.hyperledger.identus.agent.server.jobs | ||
|
||
import org.hyperledger.identus.mercury.HttpResponse | ||
import org.hyperledger.identus.shared.models._ | ||
|
||
sealed trait BackgroundJobError | ||
sealed trait BackgroundJobError( | ||
override val statusCode: org.hyperledger.identus.shared.models.StatusCode, | ||
override val userFacingMessage: String | ||
) extends Failure { | ||
override val namespace: String = "BackgroundJobError" | ||
} | ||
|
||
object BackgroundJobError { | ||
final case class InvalidState(cause: String) extends BackgroundJobError | ||
|
||
final case class ErrorSendingMessage(cause: String) extends BackgroundJobError | ||
case object NotImplemented extends BackgroundJobError | ||
final case class ErrorResponseReceivedFromPeerAgent(response: HttpResponse) extends BackgroundJobError { | ||
final case class InvalidState(cause: String) | ||
extends BackgroundJobError( | ||
statusCode = StatusCode.InternalServerError, | ||
userFacingMessage = s"Invalid State: cause='$cause'" | ||
) | ||
|
||
final case class ErrorSendingMessage(cause: String) | ||
extends BackgroundJobError( | ||
statusCode = StatusCode.BadRequest, | ||
userFacingMessage = s"ErrorSendingMessage" | ||
) | ||
|
||
case object NotImplemented | ||
extends BackgroundJobError( | ||
statusCode = StatusCode.UnexpectedNotImplemented, | ||
userFacingMessage = s"NotImplemented" | ||
) | ||
final case class ErrorResponseReceivedFromPeerAgent(response: HttpResponse) | ||
extends BackgroundJobError( | ||
statusCode = StatusCode.BadRequest, | ||
userFacingMessage = s"DIDComm sending error: [${response.status}] - ${response.bodyAsString}" | ||
) { | ||
|
||
override def toString: String = s"DIDComm sending error: [${response.status}] - ${response.bodyAsString}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.