private static function handleError(int $status, string $message = null)
    {
        if ($status === 400) {
            throw new BadRequestException($message, $status);
        }

        if ($status === 422) {
            throw new ValidationFailedException($message, $status);
        }

        if ($status === 429) {
            throw new ApiLimitExceededException($message, $status);
        }

        if ($status < 500) {
            throw new ClientErrorException($message, $status);
        }

        throw new ServerErrorException($message, $status);
    }
private static function handleError(int $status, string $message = null)
    {
        if ($status === 400) {
            throw new BadRequestException($message, $status);
        }

        if ($status === 422) {
            throw new ValidationFailedException($message, $status);
        }

        if ($status === 429) {
            throw new ApiLimitExceededException($message, $status);
        }

        if ($status < 500) {
            throw new ClientErrorException($message, $status);
        }

        throw new ServerErrorException($message, $status);
    }
private static function handleError ( int $ status , string $ message = null ) { if ( $ status === 400 ) { throw new BadRequestException ( $ message , $ status ) ; } if ( $ status === 422 ) { throw new ValidationFailedException ( $ message , $ status ) ; } if ( $ status === 429 ) { throw new ApiLimitExceededException ( $ message , $ status ) ; } if ( $ status < 500 ) { throw new ClientErrorException ( $ message , $ status ) ; } throw new ServerErrorException ( $ message , $ status ) ; }
Handle an error response.

@param int         $status
@param string|null $message

@throws \Bitbucket\Exception\RuntimeException

@return void
Handle an error response .