Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info about failing discrimintator to UnknownErrorResponse #1575

Conversation

ghostbuster91
Copy link
Contributor

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

  • Added unit-tests (for runtime code)
  • Added bootstrapped code + smoke tests (when the rendering logic is modified)
  • Added build-plugins integration tests (when reflection loading is required at codegen-time)
  • Added alloy compliance tests (when simpleRestJson protocol behaviour is expanded/updated)
  • Updated dynamic module to match generated-code behaviour
  • Added documentation
  • Updated changelog

@ghostbuster91 ghostbuster91 marked this pull request as draft August 16, 2024 20:27
@ghostbuster91 ghostbuster91 force-pushed the discriminate-reasons2 branch from 023d9e3 to fd3e907 Compare August 16, 2024 20:34
@Baccata
Copy link
Contributor

Baccata commented Aug 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants