Skip to content

Commit de60f4a

Browse files
authored
Merge: Replace general Exception raising with more detailed type
Replace general Exception raising with more detailed type
2 parents 9a46fde + 6daa6e1 commit de60f4a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
comment: false

flask_mongoengine/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(self, app=None, config=None):
104104

105105
def init_app(self, app, config=None):
106106
if not app or not isinstance(app, Flask):
107-
raise Exception("Invalid Flask application instance")
107+
raise TypeError("Invalid Flask application instance")
108108

109109
self.app = app
110110

@@ -119,7 +119,7 @@ def init_app(self, app, config=None):
119119
if self in app.extensions["mongoengine"]:
120120
# Raise an exception if extension already initialized as
121121
# potentially new configuration would not be loaded.
122-
raise Exception("Extension already initialized")
122+
raise ValueError("Extension already initialized")
123123

124124
if not config:
125125
# If not passed a config then we read the connection settings

0 commit comments

Comments
 (0)