Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Command returns 0 on failed upload #172

Open
DjThossi opened this issue Jan 10, 2021 · 0 comments
Open

Using Command returns 0 on failed upload #172

DjThossi opened this issue Jan 10, 2021 · 0 comments

Comments

@DjThossi
Copy link

DjThossi commented Jan 10, 2021

Hey

First of all, thank you for building this lib. I really like it and the possibilities with it.

I use this library within a symfony project.
I run it on command-line like this,
php bin/console --env=prod backup-manager:backup development dropbox -c gzip --filename "$(date +'%Y%m%d-%H%M%S')-backup.sql"

This command returns 0 indifferent if dropbox upload worked or not.

I figured out that this is the case because of not using the result writeStream method.

I found it in TransferFile.php

    /**
     * @throws FileExistsException
     * @throws FileNotFoundException
     */
    public function execute()
    {
        $this->destinationFilesystem->writeStream(
            $this->destinationPath,
            $this->sourceFilesystem->readStream($this->sourcePath)
        );
    }

Would it be possible, in the close future, to return the failing of writeStream up to the surface?

For it would be indifferent whether the Exception is thrown to the surface or at least the command would fail.

Background: I'd like to use the command together with healthchecks.io and know when the command finished successfully. If the command would fail I could get automatically be notified.

If you have any further question please don't hesitate to ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant