in2code-de / in2publish_core

in2publish Community Version
https://www.in2code.de/produkte/content-publisher/
GNU General Public License v3.0
40 stars 23 forks source link

Never catch exeptions and ignore its message #32

Closed georgringer closed 7 years ago

georgringer commented 7 years ago

\In2code\In2publishCore\Security\SshConnection::writeRemoteFile might throw an exception with fopen. However you never return the original message of the exception which makes it impossible to fix open issues.

E.g. we got

PHP Warning: fopen(): ssh2.sftp:// wrapper is disabled in the server configuration by allow_url_fopen=0 in ...web/typo3conf/ext/in2publish_core/Classes/Security/SshConnection.php line 495

The message you output is "Insufficient write permissions for remote file" which is not helpful ;)

Please add also the original message. Additionally it might be useful to add a test for allow_url_fopen in your test scenarios