protected function _handleDatabaseException(Zend_Db_Statement_Exception $e) {
        if (strpos($e->getMessage(), 'Duplicate entry') === false) {
            throw $e;
        }
        // Note the double spaces in the template string are required since quotes would be
        // added greedily to the parsed values.
        list($value, $index) = sscanf($e->getMessage(),
            'SQLSTATE[23000]: Integrity constraint violation: ' .
            '1062 Duplicate entry  %s  for key  %s ');

        // Throw an exception with a human-friendly error
        throw new Exception(
            sprintf(__('%s is already in use, please provide a unique value.'), $value));
    }