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

com.weaverplatform.protocol.WeaverError Maven / Gradle / Ivy

There is a newer version: 3.27.0
Show newest version
package com.weaverplatform.protocol;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;

public class WeaverError extends RuntimeException {

  public final static int
  OTHER_CAUSE                = -1,
  NODE_NOT_FOUND             = 101,
  DATATYPE_INVALID           = 322,
  DATATYPE_UNSUPPORTED       = 333,
  WRITE_OPERATION_NOT_EXISTS = 344,
  WRITE_OPERATION_INVALID    = 345,
  WRITE_OPERATION_FAILED     = 366,
  INCREMENT_ERROR            = 346,
  CONDITION_INVALID          = 442,
  DATABASE_NOT_PROVIDED      = 443,
  DATABASE_CONNECTION        = 876,
  RESULTSET_ERROR            = 743;

  @Expose
  private int code;

  @Expose
  private String message;

  private final static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();

  public WeaverError(int code, String message) {
    super(message);
    this.code = code;
    this.message = message;
  }

  public String toJson() {
    return gson.toJson(this);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy