Class ExceptionHandlingBasicsExamples

java.lang.Object
net.jrodolfo.java_evolution.java01.ExceptionHandlingBasicsExamples

public class ExceptionHandlingBasicsExamples extends Object
Refreshes checked exceptions and basic exception wrapping.
  • Constructor Details

    • ExceptionHandlingBasicsExamples

      public ExceptionHandlingBasicsExamples()
  • Method Details

    • loadRequiredValue

      public String loadRequiredValue(boolean available) throws IOException
      Declares a checked exception for callers to handle or propagate.
      Parameters:
      available - whether the resource is available
      Returns:
      loaded value
      Throws:
      IOException - when the resource is unavailable
    • loadOrThrowDomainFailure

      public String loadOrThrowDomainFailure()
      Converts a checked exception into a domain-specific unchecked exception.
      Returns:
      loaded value