Hogie Posted January 10, 2017 Report Posted January 10, 2017 I am currently writing a module that requires a direct database connection to the service. I am using the minphp-db code, but I am trying to figure out how to capture a connection error when I am testing it in the Module::addModuleRow code, but the system is capturing it and throwing up: Something went wrong. SQLSTATE[HY000] [1045] Access denied for user 'xxxxxxx'@'remotehost' (using password: YES) I'd like to figure out a way to capture that error so I can throw up an error to the user instead of a blank screen (which is what you get when Configure::errorReporting is set to 0). Any ideas? There is currently not an API available for what I am writing, so it needs to be a direct DB connection. Quote
Paul Posted January 10, 2017 Report Posted January 10, 2017 Are you using the Record component? See https://docs.blesta.com/display/dev/Database+Access Quote
Hogie Posted January 10, 2017 Author Report Posted January 10, 2017 1 hour ago, Paul said: Are you using the Record component? See https://docs.blesta.com/display/dev/Database+Access I do not see how to connect that to a different database. Not the blesta database, but a remote database for the system I am trying to get blesta to talk to. Since I will have multiple of these database clusters, I can not set the blesta and the service's databases to be the same since multiple clusters would have overlapping table names. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.