cloudfoundry / cloudfoundry/cf-java-client

Error Status Codes from Cloud Foundry API V3

Open
#1,180 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question triaged
Dominant language
Java
Stars
334
Forks
319
PR merge metrics
No merged PRs in 30d

Description

Hello everyone. Currently I am working on contribution for the get() operation for applicatons. The essence of contrubution is to migrate client implementation from v2 CF APIs to v3. In DefaultApplications Java class this method is used for getting Application details:

private static Mono<ApplicationInstancesResponse> getApplicationInstances(CloudFoundryClient
					cloudFoundryClient, String applicationId) {
	return requestApplicationInstances(cloudFoundryClient, applicationId)
	.onErrorResume(ExceptionUtils.statusCode(CF_BUILDPACK_COMPILED_FAILED, CF_INSTANCES_ERROR, 
	CF_STAGING_NOT_FINISHED, CF_STAGING_TIME_EXPIRED, CF_STAGING_ERROR),
	t -> Mono.just(ApplicationInstancesResponse.builder().build()));
}

Here we see the handling of various errors by their status codes. Method ExceptionUtils.statusCode just checks if at least one of the passed codes to this method matches the code returned from the API of the V2.

In the DefaultApplications defined following status codes:

private static final int CF_APP_STOPPED_STATS_ERROR = 200003;
    private static final int CF_BUILDPACK_COMPILED_FAILED = 170004;
    private static final int CF_INSTANCES_ERROR = 220001;
    private static final int CF_SERVICE_ALREADY_BOUND = 90003;
    private static final int CF_STAGING_ERROR = 170001;
    private static final int CF_STAGING_NOT_FINISHED = 170002;
    private static final int CF_STAGING_TIME_EXPIRED = 170007;

I want to ask a question where the list of these codes was taken from?
(I tried to find them in the CF API V2 documentation but didn't find them unfortunately.).

Also, do we have similar list of errors for CF V3 APIs? If we have could please share with me some sources, where I can find them? (I tried to find them there: https://v3-apidocs.cloudfoundry.org/version/3.131.0/index.html#errors) But it is common information about the errors and there we don't have info about the returning errors for a specific API endpoint.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the getApplicationInstances example in DefaultApplications and the behavior of ExceptionUtils.statusCode. Compare the listed V2 status codes with the Cloud Foundry API V3 error documentation linked in the issue, then identify authoritative sources for endpoint-specific errors. Done means documenting the source or confirming that no equivalent list exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.