Create a ticket
Sign in Sign up
Locker support Locker support
Results

No results found.

Home Locker Secrets Manager Developer tools Secrets - SDK Java Usages Error Handling
Vietnamese English
Error Handling

Locker Secret SDK offers some kinds of errors. They can reflect external events, like invalid credentials, network interruptions, or code problems, like invalid API calls.

If an immediate problem prevents a function from continuing, the SDK raises an exception. It’s a best practice to catch and handle exceptions. To catch an exception, use Java’s try/catch syntax. Catch LockerError or its subclasses to handle Locker-specific exceptions only. Each subclass represents a different kind of exception. When you catch an exception, you can use its class to choose a response.

Example:

LockerClient client = new LockerClient(
  "95443edf-eb33-4fae-a66d-c264d14e7217",
  "C+NCA5fwzJeCh3R4O3Dw4YLAbJrrvgJt1bJSe1BEhrY="
);

SecretCreateParams params = SecretCreateParams.builder()
  .setValue("your_secret_value")
  .setKey("your_secret_key")
  .setDescription("your_secret_description")
  .build();

try {
  Secret newSecret = client.secrets().create(params,Secret.class);
} catch (LockerError e) {
  e.printStackTrace();
}
 

In the SDK, error objects belong to LockerError and its subclasses. Use the documentation for each class for advice about how to respond.

Name
Class
Description
Authentication Error
AuthenticationError
Invalid access_client_id or invalid secret_access_key
Permission Denied Error
PermissionDeniedError
Your credential does not have enough permission to execute this operation
RateLimit Error
RateLimitError
Too many requests
API Error
APIError
You made an API call with the wrong parameters, in the wrong state, or in an invalid way or Something went wrong on Locker’s end (These are rare.)
CLI Run Error
CliRunError
The encryption/decryption binary runs errors by invalid local data, process interruptions, or invalid secret_access_key
 
Was this page helpful?
No
Yes
Join Our Community