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

What is the option/approach provided by the library to send the CALLERROR message from server to client with custom error information and correct messageId #205

Open
rayan99 opened this issue Aug 29, 2022 · 1 comment

Comments

@rayan99
Copy link

rayan99 commented Aug 29, 2022

I have implemented a server based on the example given in
ocpp-v1_6-example/json_server_example/src/main/java/eu/chargetime/ocpp/jsonserverimplementation/config/ServerCoreProfileConfig.java

I have a question regarding the following implementation as an example:

@OverRide
public StartTransactionConfirmation handleStartTransactionRequest(UUID sessionIndex, StartTransactionRequest request) {

}

In this function, if I provide the StartTransactionConfirmation correctly everything works fine.

For negative cases where I have to provide CALLERROR as per the following OCPP format:
MessageTypeId, MessageId, errorCode errorDescription, {}]

What is the option/approach provided by the library to send the error message to client with:
a) Proper error code
b) My own values for error description and details
c) Message Id. (Currently message id is not received in handler)..

Pls Note:
I explored the option of throwing runtime exception, but it has three shortcomings:

  1. I am not able to send proper error code, description and details
  2. I do not know the message Id which I have to send back since the function does not get it as parameter/any other way
  3. The error message is printed in the server but it does not reach the client

I am using following build:

	<dependency>
			<groupId>eu.chargetime.ocpp</groupId>
			<artifactId>v1_6</artifactId>
			<version>1.1.0</version>
	</dependency>
@robert-s-ubi
Copy link
Contributor

What do you consider a "negative case"? The only "negative case" in which you are allowed to reply with a CALLERROR is a malformed request, i.e. if you cannot parse the StartTransactionRequest. In that case, consider that the charge point cannot really make much of the CALLERROR. It would only help if you had a charge point developer debugging on their side, but if you're in that position, you might as well tell them directly what's wrong with their requests.

For all properly formed StartTransactionRequests, you're required to reply with a StartTransactionConfirmation.

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

No branches or pull requests

2 participants