static public function isInvalidReferenceException(Exception $e) {
        return stripos($e->getMessage(), 'No reference') !== false ||
            preg_match('/Reference rule "(.+)" does not reference table (.+)/', $e->getMessage());
    }