DB Exceptions are not getting logged

Permalink
Hi All,

I am building a competition signup package with some single pages and database interaction.

Since I migrated the app from an old non c5 page and there are already a lot of database entries, I wanted to keep the other database. I am using the built in c5 Database helper where I can switch the database to an external one.

Now I have certain user interactions, which could end up in a databse exception (In most normal case they are not, but who knows..) and so I turned on the option to also log exceptions (Database => Settings => Log).

To try that out, I manipulated a db entry which leads to a db exception when I try to save something, but in the log, there are no exceptions popping up. C5 Just shows the default production error page (Some error occured..bla..bla), but no log entry..
Is it possible, that exceptions are not logged, because I am using an external database?

Thanks for any input.
Jan

janwidmer
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
If the exceptions occur while you are using the external database (before the database switches back to the c5 database), what you suspect is likely correct.
janwidmer replied on at Permalink Reply
janwidmer
Yeah thats the case.. So I might have to think about migrate the database into c5.

What is the best approach to migrate a DB Schema with about 15 tables into c5, can I just export it from my other db and import it with a package prefix for each table directly in phpMyAdmin?

Thanks for your help
Jan
JohntheFish replied on at Permalink Reply
JohntheFish
If you create a small package, you can use the package db.xml to specify the schema for your other data. The process of installing the package will create the tables and should (afaik) throw an exception if a table name conflict occurs.

You could even put the external data dump/importer into a heredoc in the package controller and import as part of the install. Though I am not sure if that would offer any advantage over importing through phpmyadmin.

PS.
For your application, there are several boilerplate CRUD examples available. Have a look in the howtos, marketplace and in related projects.
http://www.concrete5.org/developers/open-source/...