src/ArtaxServiceBuilder/OperationGenerator.php
public function addTranslateResponseToExceptionMethod() {
        $body = 'return $this->api->translateResponseToException($response);';

        $docBlock = new DocBlockGenerator('Determine whether the response is an error. Override this method to have a per-operation decision, otherwise the function from the API class will be used.', null);

        $methodGenerator = $this->createMethodGenerator(
            'translateResponseToException',
            $body,
            $docBlock,
            [['response', 'Amp\Artax\Response']],
            ['null', '\ArtaxServiceBuilder\BadResponseException']
        );

        $this->classGenerator->addMethodFromGenerator($methodGenerator);
    }
public function addTranslateResponseToExceptionMethod() {
        $body = 'return $this->api->translateResponseToException($response);';

        $docBlock = new DocBlockGenerator('Determine whether the response is an error. Override this method to have a per-operation decision, otherwise the function from the API class will be used.', null);

        $methodGenerator = $this->createMethodGenerator(
            'translateResponseToException',
            $body,
            $docBlock,
            [['response', 'Amp\Artax\Response']],
            ['null', '\ArtaxServiceBuilder\BadResponseException']
        );

        $this->classGenerator->addMethodFromGenerator($methodGenerator);
    }
Add a method to determine whether the response should be processed into a hydrated
response class. By default it delegates that decision to the main api class - override this method
to have a per operation decision.