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

com.files.exceptions.ReportableIoException Maven / Gradle / Ivy

Go to download

The Files.com Java client library provides convenient access to the Files.com API from JVM based applications.

There is a newer version: 1.4.123
Show newest version
package com.files.exceptions;

import java.io.IOException;

public class ReportableIoException extends IOException {
  private static final long serialVersionUID = 7576106636929137462L;

  private final int apiFailureStatus;
  private final String apiFailureAction;
  private final String apiFailureReason;

  public ReportableIoException(int status, String action) {
    this.apiFailureStatus = status;
    this.apiFailureAction = action;
    this.apiFailureReason = "";
  }

  public ReportableIoException(int status, String action, String message) {
    this.apiFailureStatus = status;
    this.apiFailureAction = action;
    this.apiFailureReason = message;
  }

  public ReportableIoException(com.files.exceptions.ApiReportedRuntimeException ex) {
    this.apiFailureStatus = ex.apiFailureStatus();
    this.apiFailureAction = ex.apiFailureAction();
    this.apiFailureReason = ex.apiFailureReason();
  }

  public int apiFailureStatus() {
    return apiFailureStatus;
  }

  public String apiFailureAction() {
    return apiFailureAction;
  }

  public String apiFailureReason() {
    return apiFailureReason;
  }

  public String getMessage() {
    //TODO Better error mapping;
    return null;
  }

  public String getBrickMessage() {
    return apiFailureStatus + "." + apiFailureAction + "=" + apiFailureReason;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy