Skip to content

Commit

Permalink
Removing magic numbers from exceptions (#23997)
Browse files Browse the repository at this point in the history
* Removing magic numbers from exceptions

* Running pre-commit

(cherry picked from commit 375673a)
  • Loading branch information
bernardocouto authored and ephraimbuddy committed Jun 29, 2022
1 parent aa34428 commit 412c152
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions airflow/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""Exceptions used by Airflow"""
import datetime
import warnings
from http import HTTPStatus
from typing import Any, Dict, List, NamedTuple, Optional, Sized


Expand All @@ -31,19 +32,19 @@ class AirflowException(Exception):
Each custom exception should be derived from this class.
"""

status_code = 500
status_code = HTTPStatus.INTERNAL_SERVER_ERROR


class AirflowBadRequest(AirflowException):
"""Raise when the application or server cannot handle the request."""

status_code = 400
status_code = HTTPStatus.BAD_REQUEST


class AirflowNotFoundException(AirflowException):
"""Raise when the requested object/resource is not available in the system."""

status_code = 404
status_code = HTTPStatus.NOT_FOUND


class AirflowConfigException(AirflowException):
Expand Down

0 comments on commit 412c152

Please sign in to comment.