Skip to content

Misleading error message when https:// is not specified in target URL #69

@davidferlay

Description

@davidferlay

Steps to reproduce

docker run -it --user root:root --rm --init -v `pwd`:`pwd` -w `pwd` skilldlabs/php:74-fpm /bin/ash
composer global require elendev/composer-push --no-interaction
composer global config --no-plugins allow-plugins.elendev/composer-push true

Observed

composer push --url=repositories.XXX.com/repository/XXXX/ --username=XXXX --password="XXXX" 1.0.22

Returns error:

Pushing archive to URL: repositories.XXX.com/repository/XXX/packages/upload/XXX/formatter_video_popup/1.0.22...
  100 [============================]

                                                                                                                                                                                              
  [GuzzleHttp\Exception\RequestException]                                                                                                                                                     
  cURL error 18: transfer closed with outstanding read data remaining (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://repositories.XXX.com/repository/XXXX/packages/upload/XXXX/formatter_video_popup/1.0.22                                                                                                                            
                                                                                                                                                                                              

push [--name NAME] [--url URL] [--type TYPE] [--repository REPOSITORY] [--username USERNAME] [--password PASSWORD] [-i|--ignore [IGNORE]] [--ignore-dirs [IGNORE-DIRS]] [--ignore-by-git-attributes] [--ignore-by-composer] [--src-type SRC-TYPE] [--src-url SRC-URL] [--src-ref SRC-REF] [--keep-vendor] [--keep-dot-files] [--ssl-verify [SSL-VERIFY]] [--access-token [ACCESS-TOKEN]] [--] [<version>]

Whereas

composer push --url=https://repositories.XXX.com/repository/XXXX/ --username=XXXX --password="XXXX" 1.0.22

Returns success:

Pushing archive to URL: https://repositories.XXX.com/repository/XXXpackages/upload/XXX/formatter_video_popup/1.0.22...
  100 [============================]
Archive correctly pushed to the Nexus server

Expected

  • If composer push command requires full URL (protocol + URI), command should fail by throwing an appropriate error message instead of displaying cURL error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions