Skip to content

Commit

Permalink
Raise CommandError instead is SystemExit
Browse files Browse the repository at this point in the history
CommandError is the 'preferred way' for custom Commands.
  • Loading branch information
jor-rit authored and bittner committed Mar 4, 2020
1 parent 05a1701 commit c53f3e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_probes/management/commands/wait_for_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FILE: django_probes/management/commands/wait_for_database.py
"""
from time import sleep, time
from django.core.management.base import BaseCommand
from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django.db.utils import OperationalError

Expand Down Expand Up @@ -90,4 +90,4 @@ def handle(self, *args, **options):
try:
wait_for_database(**options)
except TimeoutError as err:
raise SystemExit(err)
raise CommandError(err)

0 comments on commit c53f3e8

Please sign in to comment.