-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@@ -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"; |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; | |||
} |
There was a problem hiding this comment.
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; | |||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.