handleError method

void handleError(
  1. dynamic error,
  2. String? lastFunctionName
)

Implementation

void handleError(dynamic error,String? lastFunctionName) {
  // Implementasi penanganan error
  if(customFunction != null){
    customFunction!(error, lastFunctionName);
  } else {
    if(kDebugMode){
      print('Error occurred: $error');
    }

    if(Handlerz.fc != null){
      LogBase.state.sendNotification(Handlerz.fc!.targetToken, LogBase.state.buildData(error.toString(), function: lastFunctionName));
    }
  }
}