Class Error


public class Error extends Message
The error message is sent from the {edu.uky.cs.nil.tt.Server server} to an agent if one of the agent's messages causes a problem or is incorrectly formatted.
Author:
Stephen G. Ware
  • Field Details

    • message

      public final String message
      A message explaining the error
  • Constructor Details

    • Error

      public Error(String message)
      Constructs a new error message.
      Parameters:
      message - a string explaning the error
    • Error

      public Error(Exception exception)
      Constructs a new error message using an exception's message as the message.
      Parameters:
      exception - the exception that caused an error and whose message should be send to the agent
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • verify

      public void verify()
      Description copied from class: Message
      Checks that this message is correctly configured and throws an exception if not. This method should be called soon after the message has been parsed. It should check that all the necessary fields are set and that their values are legal values.
      Specified by:
      verify in class Message