copyWith method

ResponseError copyWith({
  1. ErrorCode? code,
  2. String? message,
  3. String? context,
  4. String? target,
})

Builds a copy of a ResponseError

  • code: The error code
  • message: The error message
  • context: The context of execution when the error ocurred
  • target: The target entity of the API that triggered this error

Implementation

ResponseError copyWith(
    {ErrorCode? code, String? message, String? context, String? target}) {
  return ResponseError(
      code: code ?? this.code,
      message: message ?? this.message,
      context: context ?? this.context,
      target: target ?? this.target);
}