code: public function onPreDelete(ResourceEventInterface $event)
      {
          $group = $this->getCustomerGroupFromEvent($event);
  
          if ($group->isDefault()) {
              throw new IllegalOperationException(); // TODO reason message
          }
      }
docs: Pre delete event handler.
  
  @param ResourceEventInterface $event
  
  @throws IllegalOperationException