Skip to content

Commit

Permalink
log exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lukavdplas committed Nov 14, 2024
1 parent e6be44e commit 4539bd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/es/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
from typing import Optional, Dict, List
from datetime import datetime
from elasticsearch import Elasticsearch
import logging

from addcorpus import models as corpus_models
from ianalyzer.elasticsearch import client_from_config

logger = logging.getLogger()

class Server(models.Model):
'''
Represents an elasticsearch server that is configured in the project.
Expand Down Expand Up @@ -63,7 +66,8 @@ def can_connect(self) -> bool:
return False
try:
client.info()
except:
except Exception as e:
logging.error(e)
return False
return True

Expand Down

0 comments on commit 4539bd1

Please sign in to comment.