CustomException constructor

CustomException({
  1. Object? message,
  2. String? hiddenMessage,
})

Creates a CustomException.

The message can be a single object (which will be converted to a string) or a List of objects (which will be joined with newlines). If no message is provided, a default 'Unimplemented Error' message is used.

The hiddenMessage is optional and intended for internal use or logging.

Implementation

CustomException({Object? message, this.hiddenMessage}) {
  if (message == null) {
    this.message = 'Unimplemented Error';
  } else if (message is List) {
    this.message = message.join('\n');
  } else {
    this.message = message.toString();
  }
}