All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.geotab.model.error.JsonRpcErrorCode Maven / Gradle / Ivy

/*
 *
 * 2020 Copyright (C) Geotab Inc. All rights reserved.
 */

package com.geotab.model.error;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Indicates the JSON-RPC error type that occurred. Derived from JSON-RPC 2.0 specification.
 * 

* The error codes from and including -32768 to -32000 are reserved for predefined errors. Any code * within this range, but not defined explicitly below is reserved for future use. -32000 to -32099: * Server error - Reserved for implementation-defined server-errors. */ public enum JsonRpcErrorCode { /** * Invalid JSON was received by the server. An error occurred on the server while parsing the JSON * text. */ PARSE_ERROR("ParseError", -32700), /** * Internal JSON-RPC error. */ INTERNAL_ERROR("InternalError", -32603), /** * Invalid method parameter(s). */ INVALID_PARAMS("InvalidParams", -32602), /** * The method does not exist / is not available. */ METHOD_NOT_FOUND("MethodNotFound", -32601), /** * The JSON sent is not a valid Request object. */ INVALID_REQUEST("InvalidRequest", -32600), /** * The server responded with GroupRelationViolatedException. */ GROUP_RELATION_VIOLATED_ERROR("GroupRelationViolatedError", -32599), /** * The server responded with DbUnavailableException, State= DbUnavailableState.None. */ DB_UNAVAILABLE_GENERAL_ERROR("DbUnavailableGeneralError", -32590), /** * The server responded with DbUnavailableException, State= DbUnavailableState.ConnectionFailure. */ DB_UNAVAILABLE_CONNECTION_FAILURE("DbUnavailableConnectionFailure", -32589), /** * The server responded with DbUnavailableException, State= DbUnavailableState.UnknownDatabase. */ DB_UNAVAILABLE_UNKNOWN_DATABASE("DbUnavailableUnknownDatabase", -32588), /** * The server responded with DbUnavailableException, State= DbUnavailableState.Initializing. */ DB_UNAVAILABLE_INITIALIZING("DbUnavailableInitializing", -32587), /** * The server responded with DbUnavailableException, State= DbUnavailableState.OperationAborted. */ DB_UNAVAILABLE_OPERATION_ABORTED("DbUnavailableOperationAborted", -32586), /** * Invalid certificate error. */ INVALID_CERTIFICATE_EXCEPTION("InvalidCertificateException", -32001), /** * Internal server error. */ INTERNAL_SERVER_ERROR("InternalServerError", -32000), /** * The default value. */ NONE("None", 0); private String name; private int code; JsonRpcErrorCode(String name, int code) { this.name = name; this.code = code; } @JsonValue public String getName() { return name; } public int getCode() { return code; } public static JsonRpcErrorCode getByCode(Integer code) { if (code == null) { return null; } for (JsonRpcErrorCode value : values()) { if (value.getCode() == code) { return value; } } return null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy