UserException.debug constructor

  1. @deprecated
UserException.debug(
  1. String? msg, {
  2. Object? cause,
  3. ExceptionCode? code,
  4. VoidCallback? onOk,
  5. VoidCallback? onCancel,
})

Adding .debug to the constructor will print the exception to the console. Use this for debugging purposes only. This constructor is marked as deprecated so that you don't forget to remove it.

Implementation

@deprecated
UserException.debug(this.msg, {this.cause, this.code, VoidCallback? onOk, VoidCallback? onCancel})
    : _onOk = onOk,
      _onCancel = onCancel {
  print("================================================================\n"
      "UserException${code == null ? "" : " (code: $code)"}:\n"
      "Msg = $msg,\n"
      "${cause == null ? "" : "Cause = $cause,\n"}"
      "================================================================");
}