DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
8 stars 2 forks source link

Function importLog will likely cause an undecipherable exception if log file is not found (M) #165

Closed smurthys closed 6 years ago

smurthys commented 6 years ago

If connection logging is not enabled or log file names are not configured as expected, function importLog is likely raise an exception with a message that is not so helpful.

It might be helpful to first test if the result of the query SELECT setting FROM pg_settings WHERE "name" = 'log_directory' is not empty/NULL prior to entering the loop. If the result is empty/NULL we should probably raise a notice (exception?) that logging is not enabled or such.

It is also useful to understand what COPY does if the file path provided does not exist. Perhaps we can raise a custom exception.

I don't think we should try any of this for M2.

wildtayne commented 6 years ago

I believe the exception handling added for #200 addresses this, but I will add it to the epic as well. Also note that setting a weird/invalid log_directory causes Postgres to fail to start (found this out the hard way).