CloudAPIException

CloudAPIException

Version 1.10 - Updated on 05/04/2017

Contents

Introduction

public class CloudAPIException extends RuntimeException implements Serializable

General exception class forwarded to the view layer informing the user of abnormal runtime behavior.

public enum ErrorCode

The ErrorCode enum.

ERROR_NOT_IMPLEMENTED,

The feature will be implemented in the future.

ERROR_LOST_CONNECTION,

The network connection was lost.

ERROR_PARSING_DATE,

Error while parsing a date value.

ERROR_NETWORK,

An unknown network error occurred.

ERROR_IO,

A network I/O error occurred.

ERROR_FILE_NOT_FOUND,

A referenced file cannot be found.

ERROR_HTTP_CODE,

An unexpected HTTP error code was received.

ERROR_HTTP_ABORT,

The HTTP communication was aborted.

ERROR_ILLEGAL_ARGUEMENT,

An illegal argument was provided.

ERROR_GENERIC,

Generic error.

ERROR_OPERATION_IN_PROGRESS,

The operation is in progress.

ERROR_NO_SPACE,

No space left on device.

ERROR_OUT_OF_MEMORY,

Out-of-memory on device.

ERROR_UNABLE_SEND,

Error sending data.

ERROR_UNABLE_TO_CONNECT,

Error connecting.

ERROR_INVALID_LOGIN,

Error Invalid login

ERROR_DOWNLOAD,

The file could not be downloaded.

ERROR_UPLOAD,

The file could not be uploaded.

ERROR_FILE_TOO_LARGE,

The file is too large.

OPERATION_FAILED,

The operation has failed.

OPERATION_UNAUTHORIZED,

The operation is not authorized.

USER_UNAUTHORIZED,

User is Unauthorized.

INVALID_PARAMETER,

The client provided at least one invalid parameter.

OPERATION_PAUSED,

The operation has been paused and is waiting for a resume or cancel call.

OPERATION_CANCELED,

The operation has been cancelled.

OTHER_EXCEPTION,

An unspecified exception was thrown.

ERROR_PERMISSION_DENIED,

The logged-in user has insufficient permissions for the client to make this call

ERROR_INVALID_QUERY_TYPE,

Error invalid query type

ERROR_INVALID_SORT_TYPE,

Error invalid Sort type

ERROR_INVALID_SEARCH_QUERY,

Error invalid search query

ERROR_FILE_ALREADY_EXIST }

Error File already exists

public CloudAPIException(final ErrorCode code)

Instantiates a new SDK exception.

  • Parameters: code — The code

public CloudAPIException(final ErrorCode code, final int httpCode)

Instantiates a new SDK exception with an error code and a HTTP status code.

  • Parameters:
    • code — The error code
    • httpCode — The HTTP code

public CloudAPIException(final ErrorCode code, final String message)

Instantiates a new SDK exception with an error code and an error message.

  • Parameters:
    • code — The error code
    • message — The error message

public CloudAPIException(final ErrorCode code, final int httpCode, final String message)

Instantiates a new SDK exception with an error code and an error message.

  • Parameters:
    • code — The error code
    • httpCode — The HTTP code
    • message — The error message

public CloudAPIException(final ErrorCode code, final int httpCode, final int serverCode, final String message)

Instantiates a new SDK exception with an error code, an HTTP status code, a server error code, and an error message.

  • Parameters:
    • code — The error code
    • httpCode — The HTTP code
    • serverCode — The server error code
    • message — The error message

public CloudAPIException(final ErrorCode code, final int httpCode, final String serverCode, final String message)

Instantiates a new SDK exception with an error code, an HTTP status code, a server error code, and an error message.

  • Parameters:
    • code — The error code
    • httpCode — The HTTP code
    • serverCode — The server error code
    • message — The error message

public CloudAPIException(final ErrorCode defaultCode, final Exception exception)

Instantiates a new SDK exception with a root cause exception.

  • Parameters:
    • defaultCode — A default error code
    • exception — The root cause exception

public CloudAPIException(final Exception exception)

Instantiates a new SDK exception with a root cause exception.

  • Parameters: exception — The root cause exception

@Override public String getMessage()

Gets an error message.

  • Returns: An error message
  • See also: java.lang.Throwable#getMessage()

public void addToMessage(final String mes)

Adds the to message.

  • Parameters: mes — the mes

public ErrorCode getCode()

Gets the error code.

  • Returns: The code

public int getHttpCode()

Gets the HTTP status code.

  • Returns: The HTTP code

public Exception getException()

Gets the root cause exception.

  • Returns: The exception

public int getServerCode()

Gets the root cause error code returned by the Cloud API server.

  • Returns: int, default value is 0

public enum ErrorCode

The ErrorCode enum.

ERROR_NOT_IMPLEMENTED,

The feature will be implemented in the future.

ERROR_LOST_CONNECTION,

The network connection was lost.

ERROR_PARSING_DATE,

Error while parsing a date value.

ERROR_NETWORK,

An unknown network error occurred.

ERROR_IO,

A network I/O error occurred.

ERROR_FILE_NOT_FOUND,

A referenced file cannot be found.

ERROR_HTTP_CODE,

An unexpected HTTP error code was received.

ERROR_HTTP_ABORT,

The HTTP communication was aborted.

ERROR_ILLEGAL_ARGUEMENT,

An illegal argument was provided.

ERROR_GENERIC,

Generic error.

ERROR_OPERATION_IN_PROGRESS,

The operation is in progress.

ERROR_NO_SPACE,

No space left on device.

ERROR_OUT_OF_MEMORY,

Out-of-memory on device.

ERROR_UNABLE_SEND,

Error sending data.

ERROR_UNABLE_TO_CONNECT,

Error connecting.

ERROR_INVALID_LOGIN,

Error Invalid login

ERROR_DOWNLOAD,

The file could not be downloaded.

ERROR_UPLOAD,

The file could not be uploaded.

ERROR_FILE_TOO_LARGE,

The file is too large.

OPERATION_FAILED,

The operation has failed.

OPERATION_UNAUTHORIZED,

The operation is not authorized.

USER_UNAUTHORIZED,

User is Unauthorized.

INVALID_PARAMETER,

The client provided at least one invalid parameter.

OPERATION_PAUSED,

The operation has been paused and is waiting for a resume or cancel call.

OPERATION_CANCELED,

The operation has been cancelled.

OTHER_EXCEPTION,

An unspecified exception was thrown.

ERROR_PERMISSION_DENIED,

The logged-in user has insufficient permissions for the client to make this call

ERROR_INVALID_QUERY_TYPE,

Error invalid query type

ERROR_INVALID_SEARCH_QUERY,

Error invalid search query

ERROR_FILE_ALREADY_EXIST } }

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.