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

fix: add a more meaningful exception in parseAnyFromString and add classResponse to the Actions enum #62

Merged

Conversation

jggrimal
Copy link
Contributor

  • add a more meaningful exception in parseAnyFromString, when we try to parse a response without specifying a useClazz to do so (cannot be inferred from response content)

  • Add classResponse to the Actions enum in the same way as classRequest

@jggrimal jggrimal requested a review from xhanin March 13, 2024 15:43
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
14.5% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@xhanin xhanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est bien mais y a un point que je trouve overkill qui mérite d'être revu je pense

@@ -34,6 +34,13 @@ class Ocpp15JsonParser(
throw errorHandler(e)
}

override fun getResponsePayloadClass(action: String, errorHandler: (e: Exception) -> Throwable): Class<out Any> =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est overkill de fournir une lamba pour construire l'exception ici, non ? pourquoi on ne laisse pas la responsabilité à l'appelant ? C'est sans doute lié à ma demande dans l'autre projet mais maintenant qu'on fait ça ici je n'y vois pas d'interet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autant pour moi, c'est pour être consistant avec l'autre methode, donc ok pour moi

@jggrimal jggrimal merged commit f504d1f into dev Mar 13, 2024
2 checks passed
@jggrimal jggrimal deleted the feat/add-response-classes-to-actions-and-new-exception-to-parser branch March 13, 2024 16:43
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