Jump to content

Recommended Posts

Posted

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.

Posted
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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...