PDFExportException.java 924 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.github.jhonnymertz.wkhtmltopdf.wrapper;
  2. /**
  3. * PDFExportError.
  4. *
  5. * @author evgeni.gordeev
  6. * @version 1.1.3
  7. */
  8. public class PDFExportException extends RuntimeException {
  9. private String command;
  10. private int exitStatus;
  11. private byte[] out;
  12. private byte[] err;
  13. public PDFExportException(String command, int exitStatus, byte[] err, byte[] out) {
  14. this.command = command;
  15. this.exitStatus = exitStatus;
  16. this.err = err;
  17. this.out = out;
  18. }
  19. public String getCommand() {
  20. return command;
  21. }
  22. public int getExitStatus() {
  23. return exitStatus;
  24. }
  25. public byte[] getOut() {
  26. return out;
  27. }
  28. public byte[] getErr() {
  29. return err;
  30. }
  31. @Override
  32. public String getMessage() {
  33. return "Process (" + this.command + ") exited with status code " + this.exitStatus + ":\n" + new String(err);
  34. }
  35. }