is it possible to execute a function on wordpress db connection error? I mean is there any hook or something in the (error stablishing database connection) thing...? I want to do something when I get to that error.
We you want to customise your Error Establishing Database Connection to something else then you need to create a file.
Here is the documentation for that