metacat-connector-postgresql/src/main/java/com/netflix/metacat/connector/postgresql/PostgreSqlExceptionMapper.java [51:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ) {
        final String sqlState = se.getSQLState();
        if (sqlState == null) {
            throw new ConnectorException(se.getMessage(), se);
        }

        switch (sqlState) {
            case "42P04": //database already exists
                return new DatabaseAlreadyExistsException(name, se);
            case "42P07": //table already exists
                return new TableAlreadyExistsException(name, se);
            case "3D000":
            case "3F000": //database does not exist
                return new DatabaseNotFoundException(name, se);
            case "42P01": //table doesn't exist
                return new TableNotFoundException(name, se);
            default:
                return new ConnectorException(se.getMessage(), se);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



metacat-connector-redshift/src/main/java/com/netflix/metacat/connector/redshift/RedshiftExceptionMapper.java [49:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ) {
        // TODO: For now as can't find documentation stating contrary this is a copy of PostgreSQL implementation.
        //       Source code looks pretty unclear too at cursory glance
        final String sqlState = se.getSQLState();
        if (sqlState == null) {
            throw new ConnectorException(se.getMessage(), se);
        }

        switch (sqlState) {
            case "42P04": //database already exists
                return new DatabaseAlreadyExistsException(name, se);
            case "42P07": //table already exists
                return new TableAlreadyExistsException(name, se);
            case "3D000":
            case "3F000": //database does not exist
                return new DatabaseNotFoundException(name, se);
            case "42P01": //table doesn't exist
                return new TableNotFoundException(name, se);
            default:
                return new ConnectorException(se.getMessage(), se);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



