<commit_before>

package SRS::EPP::Command::Delete::Domain;

use Moose;
extends 'SRS::EPP::Command::Delete';
use MooseX::Method::Signatures;
use Crypt::Password;
use SRS::EPP::Session;
use XML::EPP::Domain;

# for plugin system to connect
sub xmlns {
    XML::EPP::Domain::Node::xmlns();
}

method process( SRS::EPP::Session $session ) {
    $self->session($session);
    my $epp = $self->message;
    my $message = $epp->message;

    my $payload = $message->argument->payload;
    my $action_id = $message->client_id || sprintf("auto.%x",time());

    return XML::SRS::Domain::Update->new(
            filter => [$payload->name],
            action_id => $action_id,
            cancel => 1,
            full_result => 0,
            );
}

method notify( SRS::EPP::SRSResponse @rs ) {
  my $message = $rs[0]->message;
  my $response = $message->response;

  if ( ! $response ) {
    # Lets just assume the domain doesn't exist
    return $self->make_response(code => 2303);
  } 
  if ( $response->isa("XML::SRS::Error") ) {
    return $self->make_response(code => 2400);
  } 
  if ( $response->status eq "Available" ) {
    return $self->make_response(code => 1000);
  }
}

1;<commit_msg>Testing has shown we sometimes didn't return anything, and that's no good<commit_after>

package SRS::EPP::Command::Delete::Domain;

use Moose;
extends 'SRS::EPP::Command::Delete';
use MooseX::Method::Signatures;
use Crypt::Password;
use SRS::EPP::Session;
use XML::EPP::Domain;

# for plugin system to connect
sub xmlns {
    XML::EPP::Domain::Node::xmlns();
}

method process( SRS::EPP::Session $session ) {
    $self->session($session);
    my $epp = $self->message;
    my $message = $epp->message;

    my $payload = $message->argument->payload;
    my $action_id = $message->client_id || sprintf("auto.%x",time());

    return XML::SRS::Domain::Update->new(
            filter => [$payload->name],
            action_id => $action_id,
            cancel => 1,
            full_result => 0,
            );
}

method notify( SRS::EPP::SRSResponse @rs ) {
  my $message = $rs[0]->message;
  my $response = $message->response;

  if ( ! $response ) {
    # Lets just assume the domain doesn't exist
    return $self->make_response(code => 2303);
  } 
  if ( $response->can("Status") ) {
    if ( $response->status eq "Available" ) {
      return $self->make_response(code => 1000);
    }
  }
  return $self->make_response(code => 2400);
}

1;
{'fraction_non_alphanumeric': 0.1770747740345111, 'fraction_numerical': 0.01314708299096138, 'mean_word_length': 3.3873873873873874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '349172', 'n_tokens_mistral': 853, 'n_tokens_neox': 808, 'n_words': 182}