-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue-1438: implemented RawErrorResponse error object
- Loading branch information
1 parent
9fb8b3b
commit 0f9e5f1
Showing
7 changed files
with
104 additions
and
81 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package smithy4s.http | ||
|
||
case class RawErrorResponse( | ||
code: Int, | ||
headers: Map[CaseInsensitive, Seq[String]], | ||
body: String, | ||
failedDecodeAttempt: Option[FailedDecodeAttempt] | ||
) extends Throwable { | ||
override def getMessage(): String = { | ||
val baseMessage = s"status $code, headers: $headers, body:\n$body" | ||
failedDecodeAttempt match { | ||
case Some(attempt) => | ||
baseMessage + s"\nFailedDecodeAttempt:\n discriminator: ${attempt.discriminator}\n contractError: ${attempt.contractError}" | ||
case None => baseMessage | ||
} | ||
} | ||
} | ||
|
||
case class FailedDecodeAttempt( | ||
discriminator: HttpDiscriminator, | ||
contractError: HttpContractError | ||
) |
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