Class MessageException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AvpException

public class MessageException extends DiameterException
Exception raised if an invalid Diameter message has been encountered.
Author:
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
See Also:
  • Constructor Details

    • MessageException

      public MessageException(ResultCode rc, String msg)
      Creates a new MessageException for the specified ResultCode and error message.
      Parameters:
      rc - the Diameter result code
      msg - the error message
    • MessageException

      public MessageException(ResultCode rc)
      Creates a new MessageException for the specified ResultCode and a default error message based on the result code.
      Parameters:
      rc - the Diameter result code
  • Method Details

    • getResultCode

      public ResultCode getResultCode()
      Returns the ResultCode indicating the error.
      Returns:
      rc error result code
    • createAnswer

      public Answer createAnswer(Request req)
      Creates a new Answer message for an invalid Request. The result code for the error will be included in the Answer, as well as an Error-Message AVP for the error message.
      Parameters:
      req - the Request that was invalid
      Returns:
      the error Answer for the request
    • unableToComply

      public static MessageException unableToComply(String msg)
      Convenience method that returns a new UNABLE_TO_COMPLY MessageException.
      Parameters:
      msg - the error cause
      Returns:
      the new MessageException