glsql: Fix error check for failed connection attempt
The error that is returned on attempt to connect with incorrect connection parameters has a dynamic values in it. This change modifies hard-coded values to be dynamic as well to better match actual error.