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

Support other http error codes #1

Merged
merged 2 commits into from Nov 28, 2023

Conversation

ubipzachacz
Copy link
Collaborator

No description provided.

@@ -451,6 +455,9 @@ private void closeConnectionDueToInternalServerError(RuntimeException exception)
private ByteBuffer generateHttpResponseDueToError(int errorCode) {
String errorCodeDescription;
switch (errorCode) {
case 401:
errorCodeDescription = "401 WebSocket Authentication Failure";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if that is binding, but in OCPP 2.0.1, it says "HTTP/401 Authorization Required", so maybe the text should be "401 Authorization Required"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think in the test it only checks error code but we can change it to be aligned with OCPP 2.0.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -49,6 +51,17 @@ public InvalidDataException(int closecode) {
this.closecode = closecode;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This constructor should initialize httpErrorCode = null

@@ -60,6 +73,19 @@ public InvalidDataException(int closecode, String s) {
this.closecode = closecode;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This constructor should initialize httpErrorCode = null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not required as I used Integer so if not initialized it will be null

@robert-s-ubi robert-s-ubi merged commit 6950895 into master Nov 28, 2023
@robert-s-ubi robert-s-ubi deleted the support-other-http-error-codes branch November 28, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants