Class RegistryException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.github.robtimus.os.windows.registry.RegistryException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidRegistryHandleException, NoSuchRegistryKeyException, NoSuchRegistryValueException, RegistryAccessDeniedException, RegistryKeyAlreadyExistsException

public class RegistryException extends RuntimeException
Thrown when an error occurred while trying to access or modify the Windows registry.
Author:
Rob Spoor
See Also:
  • Constructor Details

    • RegistryException

      public RegistryException(int errorCode, String path)
      Creates a new exception.
      Parameters:
      errorCode - The error code that was returned from the Windows API.
      path - The path of the registry key for which this exception was thrown.
    • RegistryException

      public RegistryException(int errorCode, String path, String machineName)
      Creates a new exception.
      Parameters:
      errorCode - The error code that was returned from the Windows API.
      path - The path of the registry key for which this exception was thrown.
      machineName - The remote machine of the registry key for which this exception was thrown, or null for the local machine.
      Since:
      1.1
  • Method Details

    • errorCode

      public int errorCode()
      Returns the error code that was returned from the Windows API.
      Returns:
      The error code that was returned from the Windows API.
    • path

      public String path()
      Returns the path of the registry key for which this exception was thrown.
      Returns:
      The path of the registry key for which this exception was thrown.
    • machineName

      public String machineName()
      Returns the remote machine of the registry key for which this exception was thrown.
      Returns:
      The remote machine of the registry key for which this exception was thrown, or null for the local machine.
      Since:
      1.1