1. /*
  2. * @(#)file BerException.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 4.12
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. /**
  13. * Exception thrown when a BER encoding/decoding error occurs.
  14. *
  15. * <p><b>This API is a Sun Microsystems internal API and is subject
  16. * to change without notice.</b></p>
  17. * @version 4.12 12/19/03
  18. * @author Sun Microsystems, Inc
  19. *
  20. * @since 1.5
  21. */
  22. public class BerException extends Exception {
  23. public static final int BAD_VERSION=1;
  24. private int errorType= 0;
  25. public BerException() {
  26. errorType= 0;
  27. }
  28. public BerException(int x) {
  29. errorType= x;
  30. }
  31. public boolean isInvalidSnmpVersion() {
  32. if (errorType == BAD_VERSION)
  33. return true;
  34. else
  35. return false;
  36. }
  37. }