Class UnwrapException

java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.kylesilver.result.UnwrapException
All Implemented Interfaces:
Serializable

public class UnwrapException extends Exception
This exception is thrown when a value is unwrapped. Unwrapping means that the Result was not what was expected and should be treated as fatal. It is a checked exception to discourage the practice of catching unwraps. To avoid muddying your method signatures with this exception, consider supplying a default value or coming up with a way to gracefully handle exceptions. You can also use the Result.expect(Function) method to throw a custom error instead of this one.
See Also:
  • Constructor Details

    • UnwrapException

      public UnwrapException(String s)