Add more previous exceptions to database setup code

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2021-01-07 21:04:11 +01:00
parent f1921364d6
commit d0ac76a77c
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
4 changed files with 5 additions and 4 deletions

View File

@ -218,6 +218,7 @@ class Install extends Command {
private function printThrowable(OutputInterface $output, Throwable $t): void { private function printThrowable(OutputInterface $output, Throwable $t): void {
$output->write('<info>Trace: ' . $t->getTraceAsString() . '</info>'); $output->write('<info>Trace: ' . $t->getTraceAsString() . '</info>');
$output->writeln('');
if ($t->getPrevious() !== null) { if ($t->getPrevious() !== null) {
$output->writeln(''); $output->writeln('');
$output->writeln('<info>Previous: ' . get_class($t->getPrevious()) . ': ' . $t->getPrevious()->getMessage() . '</info>'); $output->writeln('<info>Previous: ' . get_class($t->getPrevious()) . ': ' . $t->getPrevious()->getMessage() . '</info>');

View File

@ -66,7 +66,7 @@ class MySQL extends AbstractDatabase {
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->logException($e); $this->logger->logException($e);
throw new \OC\DatabaseSetupException($this->trans->t('MySQL username and/or password not valid'), throw new \OC\DatabaseSetupException($this->trans->t('MySQL username and/or password not valid'),
$this->trans->t('You need to enter details of an existing account.')); $this->trans->t('You need to enter details of an existing account.'), 0, $e);
} }
} }

View File

@ -74,14 +74,14 @@ class OCI extends AbstractDatabase {
. ' ORACLE_SID=' . getenv('ORACLE_SID') . ' ORACLE_SID=' . getenv('ORACLE_SID')
. ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH') . ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH')
. ' NLS_LANG=' . getenv('NLS_LANG') . ' NLS_LANG=' . getenv('NLS_LANG')
. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable'); . ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable', 0, $e);
} }
throw new \OC\DatabaseSetupException($this->trans->t('Oracle username and/or password not valid'), throw new \OC\DatabaseSetupException($this->trans->t('Oracle username and/or password not valid'),
'Check environment: ORACLE_HOME=' . getenv('ORACLE_HOME') 'Check environment: ORACLE_HOME=' . getenv('ORACLE_HOME')
. ' ORACLE_SID=' . getenv('ORACLE_SID') . ' ORACLE_SID=' . getenv('ORACLE_SID')
. ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH') . ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH')
. ' NLS_LANG=' . getenv('NLS_LANG') . ' NLS_LANG=' . getenv('NLS_LANG')
. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable'); . ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable', 0, $e);
} }
$this->config->setValues([ $this->config->setValues([

View File

@ -99,7 +99,7 @@ class PostgreSQL extends AbstractDatabase {
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->logException($e); $this->logger->logException($e);
throw new \OC\DatabaseSetupException($this->trans->t('PostgreSQL username and/or password not valid'), throw new \OC\DatabaseSetupException($this->trans->t('PostgreSQL username and/or password not valid'),
$this->trans->t('You need to enter details of an existing account.')); $this->trans->t('You need to enter details of an existing account.'), 0, $e);
} }
} }