Class WrappedResponseDto<T>


  • public class WrappedResponseDto<T>
    extends Object
    In REST, when we have an error, at most we would see a HTTP status code. But it can be very useful to get an actual description of the error. So, it is a common practice to have "Wrapped Responses", which can contain the error message (if any) Created by arcuri82 on 05-Nov-18.
    • Field Detail

      • data

        public T data
        The actual payload we are sending and are "wrapping" here
      • error

        public String error
        A message describing the error, if any. If this is not null, then "data" must be null.
    • Constructor Detail

      • WrappedResponseDto

        public WrappedResponseDto()