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

Empty OctanePartialException #132

Closed
alb-i986 opened this issue Dec 30, 2021 · 1 comment · Fixed by #138
Closed

Empty OctanePartialException #132

alb-i986 opened this issue Dec 30, 2021 · 1 comment · Fixed by #138

Comments

@alb-i986
Copy link
Contributor

When an error triggers an OctanePartialException the system doesn't provide any feedback on what actually happened.

com.hpe.adm.nga.sdk.exception.OctanePartialException
	at com.hpe.adm.nga.sdk.network.google.GoogleHttpClient.wrapException(GoogleHttpClient.java:454)
	at com.hpe.adm.nga.sdk.network.google.GoogleHttpClient.executeRequest(GoogleHttpClient.java:410)
	at com.hpe.adm.nga.sdk.network.google.GoogleHttpClient.execute(GoogleHttpClient.java:336)
	at com.hpe.adm.nga.sdk.network.google.GoogleHttpClient.execute(GoogleHttpClient.java:319)
	at com.hpe.adm.nga.sdk.network.OctaneRequest.getEntitiesResponse(OctaneRequest.java:81)
	at com.hpe.adm.nga.sdk.entities.create.CreateHelper.createEntities(CreateHelper.java:56)
	at com.hpe.adm.nga.sdk.entities.create.CreateTypedEntities.execute(CreateTypedEntities.java:52)
	at com.example.octane.OctaneClient.createDefects(OctaneClient.java:28)
	at com.example.octane.OctaneClientTest.createDefectAndRetrieve(OctaneClientTest.java:48)

I analysed the code, and the problem is that you are not setting message in the super class.

public class OctanePartialException extends RuntimeException{

	private Collection<EntityModel> entities = null;
	private Collection<ErrorModel> errors = null;
	
	/**
	 * Creates a new OctanePartialException object based on errors and entities models
	 * 
	 * @param errorModels - error models
	 * @param entities - entities models  
	 */
	public OctanePartialException(Collection<ErrorModel> errorModels, Collection<EntityModel> entities){
		
		setEntitiesModels(entities);
		setErrorModels(errorModels);
		
	}

For example, you could be calling super("my custom error message") in the constructor.

@alb-i986
Copy link
Contributor Author

alb-i986 commented Jan 3, 2022

PS: I forgot to mention that I'm using sdk-src:15.1.60

@SurubariuRazvan SurubariuRazvan linked a pull request Feb 3, 2022 that will close this issue
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 a pull request may close this issue.

2 participants