disneystreaming / smithy4s

https://disneystreaming.github.io/smithy4s/
Other
351 stars 72 forks source link

Add info about failing discrimintator to UnknownErrorResponse #1575

Closed ghostbuster91 closed 3 months ago

ghostbuster91 commented 3 months ago

PR Checklist (not all items are relevant to all PRs)

Baccata commented 3 months ago

In all frankness, if we're gonna target 0.19, I think Gary's code change to remove the type-parametrisation of the discriminator is better to take care of the requirement of "what did we attempt" without needing to amend other functions.

I'd rather you built on top of that, and changed the FailedDecodeAttempt model to something like :

sealed trait FailedDecodeAttempt 
object FailedDecodeAttempt {
  case class UnrecognisedDiscriminator(discriminator : HttpDiscriminator) extends FailedDecodeAttempt 
  case class DecodingFailure(...) extends FailedDecodeAttempt // what's in the current `FailedDecodeAttempt`
}

Therefore, I'm closing this PR.